Hamster
Hamster-Classic Vr. 1.3.21

Release Notes

Installation

Menus

Hamster-Scripts (*.hsc)

Hamster-Scripts Vr. 2 (*.hsc)

Hamster-Event-objects (Win32)

Hamster-Mutex-objects (Win32)

Automation (OLE)

Files and directories

File: IPAccess.hst

File: Scores.hst

File: MailFilt.hst

Error-codes and -messages

Links to Hamster-related sites and infos

Acknowledgements

License

--

See menu "Help / About ..." for additional information on this Hamster

release (current maintainer, authors, download links etc.).


Release Notes

Note:

Starting with version 1.3.20, Hamster was released as Open Source, so there might be [slightly] different versions out there.

Starting with version 1.3.19, Hamster's former internal groups named "hamster.misc", "hamster.posted" and "hamster.errors" were replaced by one group named "internal.misc".

This was changed to not confuse YOU (;-) with other groups named "hamster.*", because "hamster" is planned to be used (and partly is already used) as the hierarchy-name for Hamster-related groups.

To continue with the former groups (not suggested), you have to add the following lines under [Setup] in file Hamster.ini:

internalgroup.default=hamster.misc

internalgroup.postok=hamster.posted

internalgroup.posterrors=hamster.errors

See "Files and Directories" for more details on these settings.

Starting with version 1.3.5, a new file-format is used for the history. If you are upgrading an older version of Hamster, the new files will be created automatically when starting the new Hamster for the first time. The old history-file "History.dat" in "Groups"-directory may (and should) be deleted.

Starting with version 1.3.3, it's not possible any more to access Hamster's NNTP- and POP3-servers without prior authentication. If you are upgrading an older version of Hamster, you have to enter a password for the default-account "admin" under "File/Configuration/Accounts" and use these settings for authentication in your news- or mail-client (i.e. "admin" as username and the password chosen).


Links to Hamster-related sites and infos

http://www.onelist.com/subscribe/ehamster/

Hamster mailinglist (english).

Hamster-Mailingliste (englisch).

http://www.onelist.com/subscribe/fhamster/

Hamster mailinglist (french).

Hamster-Mailingliste (französisch).

http://www.elistas.net/foro/hamster/

Hamster mailinglist (spanish).

Hamster-Mailingliste (spanisch).

http://www.onelist.com/subscribe/usehamsternet/

Hamster mailinglist (german).

Hamster-Mailingliste (deutsch).

http://www.alphalink.com.au/~johnf/hamster.htm

Additional description for Hamster-setup and configuration; especially (but not only) for use with Forté Agent by John Fitzsimons.

Ergänzende Installations- und Konfigurationshinweise von John Fitzsimons (englisch).

http://funix.free.fr/informatique/windows/hamster.htm

Additional description for Hamster-setup and configuration by Olivier Hoarau (french).

Ergänzende Konfigurationshinweise von Olivier Hoarau (französisch).

http://hamster.ist-super.de/

http://home.t-online.de/home/micha-wr/hamster/index.htm

Many Hamster-related informations and a^Hthe script-archive (in german) by Michael Gebert.

Viele Infos zu Hamster und ein^H^H^Hdas Scriptarchiv von Michael Gebert.

http://www.elfden.co.uk/

English translation of Michael Gebert's page (see above) by elfin.

Englische Übersetzung von Michas Seite (s.o.) von elfin.

http://www.planet-interkom.de/ulehmann/index.html

Documentation for Hamster in german by Uwe Lehmann, Joerg Behrend and Christian Fritz.

Deutschsprachige Hamster-Beschreibung von Uwe Lehmann, Joerg Behrend und Christian Fritz.

http://home.pages.de/~heikor/

Additional programs and useful WSH-enhancements by Heiko Rost.

Zusatzprogramme und nützliche WSH-Erweitungen von Heiko Rost.

http://home.wtal.de/fritzwww/hamster/

German translation of this helpfile by Christian Fritz.

Deutsche Übersetzung dieser Hilfedatei von Christian Fritz.

http://home.knuut.de/tgl/

Additional Hamster-tools by Thomas G. Liesner (german).

Hamster-Zusatztools von Thomas G. Liesner.

http://www.fortunecity.de/kraftwerk/prodigy/261/

"Laufrad" by Wolfgang Krietsch.

"Laufrad" von Wolfgang Krietsch (englisch).

http://www.x501.de/hamster/

Hamster-related informations by Jürgen Denzler (german).

Infos zu Hamster von Jürgen Denzler.


Acknowledgements

The "regular expression"-routines used in Hamster use a Win32-port of "Perl-Compatible Regular Expression (PCRE)" written by Philip Hazel (<ph10@cam.ac.uk>), Copyright (c) 1997-2000 by University of Cambridge (see ftp://ftp.cus.cam.ac.uk/pub/software/programs/pcre/ for more details) .

Although the wrapper-class used for PCRE uses a slightly different approach, parts of it are at least inspired by the concepts used in "uperlre". "uperlre" is a wrapper-class for PCRE written by Luu Tran (<luu@xnews.3dnews.net>), author of "XNews"-newsreader (see http://xnews.3dnews.net/ for more details).

Thanks! :-)


License

============================================================================

Hamster, a free news- and mailserver for personal, family and workgroup use.

Copyright (c) 1999, Juergen Haible (<juergen.haible@t-online.de>).

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to

deal in the Software without restriction, including without limitation the

rights to use, copy, modify, merge, publish, distribute, sublicense, and/or

sell copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS

IN THE SOFTWARE.

============================================================================

--

See menu "Help / About ..." for additional information on this Hamster

release (current maintainer, authors, download links etc.).


Installation

Install Hamster

Unzip the files to the desired directory and start "hamster.exe" - that's it.

This works for new installations and updates of older Hamster-versions.

Setup a password for Hamster's "admin"-account

To access Hamster with a news- or mail-client, you first have to provide a password for the default "admin"-account.

To do this, select menu "File / Configuration" and go to the page named "Local accounts". The list on this page contains one selected account named "admin, Hamster Administrator". Press the "Edit"-button to show its settings.

To change the password for the account, press the "Change"-button next to the "Password"-field and enter the desired string. After closing the account-window with the "OK"-button, the "Password:"-field should show "{SET}".

Setup your newsreader

To access the newsserver-part of Hamster with a newsreader, you have to configure it with a newsserver-name and appropriate authentication-information.

One newsserver-name, that always works, is  127.0.0.1 , which is an IP-address pointing to the current computer. In most cases, the name  localhost  should work, too.

The required settings for authentication are username  admin  and the password you have assigned to this account in the step above.

If the settings are correct, you can connect to Hamster now and get the list of available newsgroups. The list should contain the predefined local group named internal.misc. Try to post an article to the group internal.misc and see, if you get your article back when pulling new news.

Setup your mail-client

Similar to the setup of the newsreader, you can use  127.0.0.1  or  localhost  for the names of the mailservers. Use this name for both servers, i.e. for POP3 (receive mails) and SMTP (send mails).

Again, the required settings for authentication (POP3 only) are username  admin  and the password you have assigned to this account.

If the settings are correct, you can connect to Hamster now. Try sending a mail to one of the addresses noted below and see, if you get your mail back from Hamster.

Here are some examples of addresses, which will be kept local and won't be sent out with Hamster's default-settings:

admin  (i.e. without a trailing "@"-part)

admin@hamster

admin@localhost

admin@127.0.0.1

admin@[127.0.0.1]

admin@something.invalid

All of these addresses result in a (local-only) mail to Hamster's admin-account. The only reason for giving some alternatives here, is, that some mail-clients might refuse some of these addresses. Just try the addresses from top to down and use the first format, your mail-client accepts.

And now you are ready to  ...  enter the unfinished quick&dirty-part of the helpfile:

Loading news

The following steps are neccessary, if you want Hamster to get the list of available groups from the newsserver of your provider and to subscribe to some of them:

- Select menu "File / Configuration" and add your newsserver(s) on page

  "Newsserver"

- (Go Online)

- Select menu "Online / All servers (News+Mail)" to load the list of available

  groups (this may take some time; wait until "Threads: 0" is shown again in

  the lower left corner of the screen).

- (Go Offline)

- Select Menu "File / Configuration" again and add your favorite groups

  on the "News-Pulls"-page.

- (Go Online)

- Select menu "Online / All servers (News+Mail)" again to load the articles.

- (Go Offline)

- Start your newsreader, refresh the newsgroups list, subscribe to the groups

  and load new articles.


Menus

Menu: File

Configuration

Newsserver

Newsgroups

News-Pulls

Mailserver

Passwords

Local Accounts

Local Servers

Settings

Online-Menu

Killfile-Log/-Settings

Killfile-Log

Killfile-Settings

Rebuild global lists

Purge all groups

Rebuild history

Clear counters+log

Refresh menu items

Menu: Online

1-9: ???

All servers (News+Mail)

Stop all tasks

Menu: Script

(available script-files)

Edit

Edit modules

Stop all scripts

Menu: Local

Start/Stop Newsserver (NNTP)

Start/Stop Mailserver (POP3)

Start/Stop Mailserver (SMTP)


Configuration, Newsserver
Menu: File / Configuration / Newsserver

Load news from (Server, Port):

Here you have to define the newsservers, where you want to pull articles from or post articles to.

To add a new newsserver, press [Add] and enter the name of the newsserver and the port-number to use, both separated by a single comma (e.g. "news.myprovider.com,nntp"). The list of available newsgroups for new servers will be loaded automatically the next time you go online.

To override some default-settings for a newsserver, select it in the list and press [Settings]. This page also allows (re-) loading the list of available groups and their descriptions.

To delete a newsserver, select it in the server-list and press [Delete].

Preferred Post-Server:

Posted articles will only be sent to the newsserver, where the given newsgroup is pulled from. If you pull the group from different servers, the first server in the list above is used. To override this behaviour, you can select a "preferred post-server", which will always be used for posting, if the given groupname is pulled from it.

To select this "preferred post-server", select a newsserver in the server-list and press [Select].


Configuration, Newsgroups
Menu: File / Configuration / Newsgroups

Available newsgroups:

This is the list of available newsgroups, you can read from Hamster with your newsreader. Groups, that are not listed in "News-Pulls" too, are assumed to be local-only (i.e. posted articles will not be posted to other newsservers).

One local newsgroup is always created by default: "internal.misc". This group is used to store reports and notifications created by Hamster.

To add a group by selecting it from the grouplist[s] loaded from the newsserver[s], press [Add/Select].

To add a group manual, press [Add/Local] and enter the groupname.

To override some default-settings for a group, select it in the list and press [Settings].

To delete a newsgroup, select it in the server-list and press [Delete].


Configuration, News-Pulls
Menu: File / Configuration / News-Pulls

Groups to pull from server (groupname,servername):

This is the list of newsgroups, which are pulled from newsservers. Each entry in the list is a combination of a newsgroup-name and a server-name, and it means, that the given group should be pulled from the given server.

Normally it should be sufficient, to pull a group from only one server (the "fastest"/"best" server), but you might also define additional entries for a group.

To add new news-pulls, press [Add] and select a combination of groupname and newsserver from the presented lists (if the lists are empty, you have to go online and start a transfer first, to load the list of available groups).

After finding and selecting the wanted groups in the upper part of the window, press [Find pulls] to get a list of available pulls for the selected groups. To subscribe to some of them, select the wanted pulls in the lower part and press [OK].

To delete a news-pull, select it in the list and press [Delete].


Configuration, Mailserver
Menu: File / Configuration / Mailserver

[POP3] Load mails from (Server, Port):

Here you can define the mailservers, where you want to load mails from by POP3.

To add a POP3-server, press [Add] and enter the name of the POP3-server and the port-number to use, both separated by a single comma (e.g. "pop.myprovider.com,pop3").

To delete a POP3-server, select it in the list and press [Delete].

[SMTP] Send mails to (Server, Port):

Here you can define the mailservers, where you want to send mails with by SMTP.

To add a SMTP-server, press [Add] and enter the name of the SMTP-server and the port-number to use, both separated by a single comma (e.g. "pop.myprovider.com,smtp").

To delete a SMTP-server, select it in the list and press [Delete].

Note:

If a server requires authentication with SMTP AUTH, you have to create/edit the file named ".\Servers\(servername)\Server.ini" and add the line "AUTH=1" under section "[SMTP]" (see "Files and directories" for details).

Preferred Send-Server:

This is the default SMTP-server used for sending mails. It is always used, if it is not "excluded" by a definable "Online-Menu"-item used to start a transfer.

To select this "preferred send-server", select a SMTP-server in the list and press [Select].


Configuration, Passwords
Menu: File / Configuration / Passwords

Usernames and passwords for servers, RAS-connections and scripts:

Here you can set the usernames and passwords for the defined news-/mail-servers and for your RAS-dialups. The settings for the RAS-connections are only needed, if Hamster should be able to dial by itself.

The additional settings named "$1", "$2", ..., "$99" are "general-purpose"-passwords, which can be used in some script-commands. Instead of noting usernames and passwords in clear-text in the scripts, one of these settings can be used by using "$number" for the username and leaving the password field empty.

There are three different states, a password setting can have. They are displayed as:

- "{ASK}"	Hamster will ask you for username and/or password when needed.

- "{SET}"	Username and/or password is set and stored in "Password.!!!" (see notes below).

- "{NONE}"	Username/password is empty, i.e. not needed (e.g. authentification by IP-number).

To edit the settings of an item, select it in the list and press [Edit].

To clear username and password (i.e. set both to "{NONE}"), select the according item in the list and press [Clear].

Using APOP-authentication for POP3 servers:

To use APOP for authentication, the password has to be preceded with "APOP:". If your password "accidentially" starts with "APOP:", you may force USER/PASS-authentication by preceding it with "PASS:".

Examples:

secret	=>   Uses USER/PASS with password "secret" (default)

APOP:secret	=>   Uses APOP with password "secret".

PASS:APOP:secret	=>   Uses USER/PASS with password "APOP:secret".

PASS:PASS:secret	=>   Uses USER/PASS with password "PASS:secret".

Using AUTH-authentication for SMTP servers:

If a SMTP server requires authentication with AUTH, you have to additionally create/edit the file named ".\Servers\(servername)\Server.ini" and add the line "AUTH=1" under section "[SMTP]" (see "Files and directories" for details).

Important notes:

The password-settings will be saved in the file "Password.!!!".

Do NOT send this file to me or anybody else, even if you have login- or other problems!

The entries in "Password.!!!" are coded with "Blowfish"-algorithm. The key used to code the data is a combination of fixed items and different OS-settings like PC-Name, OS-version etc.

The stored and coded data consists of username and password, and it is indexed by a hash-value for the according server-/RAS-name (i.e. this name is not stored in plain-text, but in a form, to find the entry again when needed).

If this all sounds "safe", be aware, that it is NOT really!

Even if the key depends on the PC where it was generated, the items used are in fact "guessable"!

But hey, other programs use XOR or ROT13 to code such things ... ;-)


Configuration, Local Accounts
Menu: File / Configuration / Local Accounts

Name, Full name, Password:

Here you can create and modify the local user-accounts, which will be used for authentication when accessing the local servers.

To add a new account, press [Add]. The settings of the selected account will be used as defaults for the new account.

To edit the settings of an account, select it in the list and press [Edit].

To delete an account, select it in the list and press [Delete].

Account-settings:

The User-ID is just a unique number to identify the account. It is assigned by Hamster when creating the account and can't be changed.

Username and Password are used for authentication when the user logs in to the local NNTP- or POP3-server. The (also unique) Username is assigned when the account is created and can't be changed afterwards. To change the Password, press [Change].

Full name has no special meaning. You can use it to identify the account, e.g. "John Doe (news-only)".

Local NNTP-server:

The setting "Groups, the user may read" determines, which groups are visible to and readable by the user, and the setting "Groups, the user may post to" determines, to which of these "visible/readable" groups the user may post to. The format of both settings is described below under "Group-selection".

Local POP3-server:

The setting "User has a POP3-mailbox" determines, if the account has a local POP3-mailbox. Accounts without a POP3-mailbox can't receive mails from Hamster.

If "Local mail-addresses" are specified, all mails for these addresses received by the local SMTP-server are not sent out, but delivered locally to the user. Multiple addresses must be separated with a single space-character, e.g. "john.doe@provider.one jd@provider.two".

Local SMTP-server:

If "SMTP-after-POP3" is enabled for the local SMTP-server, the setting "User may send mails" determines, if the user is allowed to send mails.

Group-selection

The group-selection consists of a list of regular expressions, each expression separated by one space-character. The expressions are tested from left to right and the first matching regex-pattern determines, if a groupname is OK or not. If a regex-expression is preceded by a "!", this means "not", so the result is inverted.

Examples:

Selection:	.*

Meaning:	All groups are allowed.

Selection:	!.*

Meaning:	No groups are allowed (as this is default, the field can remain empty in this case).

Selection:	!^internal\. .*

Meaning:	All groups except Hamster's internal groups are allowed.

Selection:	.* !^internal\.

Meaning:	All groups are allowed (remember: first matching pattern determines the result,

and ".*" always matches all groups).

Selection:	^de\. !^internal\.posted ^internal\.

Meaning:	All "de"-groups and all "hamster"-groups except "internal.posted" are allowed.

Special account "nntpdefault":

If an account with username "nntpdefault" and password "*" is created, its NNTP-settings will be used, if user accesses the local NNTP-server without prior authentication.


Configuration, Local Servers
Menu: File / Configuration / Local Servers

Newsserver (NNTP):

Autostart, Port:

When "Autostart" is marked, the local NNTP-server (=pull and post USENET-news from/to Hamster) is started automatically on the specified "Port"-number when Hamster is loaded. The default port-number for NNTP is "119".

Generate Message-ID:

If this setting is marked, Hamster will add a unique Message-ID to a posted article, if it was posted without one (i.e. Hamster does not overwrite existing Message-IDs).

The local-part of the Message-ID consists of coded values for current time, task-number and a counter per time (similar to Message-IDs generated by INN), which is unique for your local PC.

The domain-part is your unique FQDN, which you have to enter under "Local Domains" (see below).

Allow POST with unknown groups:

By default, all articles (cross-) posted to "unknown groups" (i.e. groups not available through Hamster) are rejected.

If this setting is marked, postings with syntactically correct newsgroup-names are accepted, even if they are not "known" by Hamster. As this allows postings in ALL groups, it is NOT recommended in multiuser-environments!

The following restrictions apply, even if this setting is marked:

- one of the groups has to be a "known" one

- max. 2 "unknown" groups are allowed, if no "Followup-To" is set.

- max. 5 groups are allowed, if no "Followup-To" is set.

Days to keep data (Articles, History, Killfile-Log):

Here you can set, how many days Hamster will keep data. By now, this setting means "minimal" days, as you have to start the purging of old data manually ...

"Articles":

This setting controls, how long the articles itself are stored, based on date/time, when the article was loaded (i.e. the "Date:"-header is not relevant for this).

"History":

The "History" is a list of Message-IDs of already loaded articles, which is used to check, if an article has already been loaded from (another) newsserver. This file (".\Groups\History.dat") is kept completely in memory and each article has to be checked in this list before loading it.

Therefore, the higher this value, the more memory and (maybe costly) online-time is needed for Hamster. To give you a hint: My own history-file on a P133 is about 500 KB, and I have not noticed any problems so far with this size.

"Killfile-Log":

The "Killfile-Log" (".\Groups\Kills.log") is used to store the overview-information of articles, which were not loaded due to scorefile-settings. If you're not interested in observing them or loading some of them manually, you can set it to "0" days.

Mailserver (POP3):

Autostart, Port:

When "Autostart" is marked, the local POP3-server (=get collected mails from Hamster) is started automatically on the specified "Port"-number when Hamster is loaded. The default port-number for POP3 is "110".

Mailserver (SMTP):

Autostart, Port:

When "Autostart" is marked, the local SMTP-server (=send mails to Hamster) is started automatically on the specified "Port"-number when Hamster is loaded. The default port-number for POP3 is "25".

Generate Message-ID:

Same as for NNTP (see above).

SMTP-after-POP3:

Enables "SMTP-after-POP3", which means, that a connection is rejected, if there was no successful POP3-authentication from the same IP-address within the last 5 minutes (default; the duration can be changed in Hamster.ini).

SMTP AUTH:

Enables "SMTP authentication", which means, that the client has to authenticate before sending mails.

Local Domains:

FQDN for Message-ID:

Here you can enter your FQDN (Fully Qualified Domain Name), which uniquely identifies your PC.

This setting is used for the domain-part of a Message-ID generated by Hamster.

Local mail-delivery, if domain-part of recipient matches this regex:

If the domain-part of a mail-recipient (the text following the "@"-character) matches the specified regular expression, the mail is not send out, but is "only" delivered locally.

If the local-part of the mail-address is the username of a local account and the account has a local POP3-mailbox, the mail is sent to this user, otherwise it is not rejected but forwarded to "admin" (this behaviour will be changed in a furture version).

The default-setting is:

.*hamster|\[?127\.0\.0\.1\]?|.*invalid

Examples for "local" addresses covered by this setting:

.*hamster	someone@something.hamster

\[?127\.0\.0\.1\]?	someone@127.0.0.1, someone@[127.0.0.1]

.*invalid	someone@nospam.invalid

Note:

Addresses without a domain-part or domains without at least one dot (".") in it are always assumed to be local-only, regardless of this setting.


Configuration, Settings
Menu: File / Configuration / Settings

Pull-Limit (default/empty group):

Here you can limit the number of articles loaded per group in each online-session.

When loading articles for the first time (i.e. after a new group is added), the setting at "(empty group)" is used. Subsequent loads will use the "(default)"-setting.

Possible values are:

- "0"	Load all available articles.

- >0	Only load the given number of newest available articles (e.g. "100").

- <0	Only load the given number of oldest available articles (e.g. "-100").

[X] Leave mails on server, i.e. do not delete them

If checked (=default), mails loaded by POP3-client of Hamster will not be deleted from any server.

If unchecked, mails will be deleted after loading them, unless a server-specific setting is given in file Server.ini (setting "LeaveOnServer=1" under "[POP3]").

[X] Ignore already loaded mails, i.e. do not load them again

This function makes use of POP3's UIDL-command to recognize already loaded mails. If this option is checked and the server supports UIDL, mails will be loaded only once.

Hamster: [X] Start as icon

If checked, Hamster is minimized to a small icon in system-tray when started.

Hamster: [X] Minimize on close

If checked, Hamster is only minimized to a small icon in system-tray when then main-window is about to be closed. To really close Hamster, you have to use menu-item "File / Exit" then.

Session-logfiles to keep:

Each time Hamster is started, a new logfile (".\Logs\0.log") is created and the old ones are backup up by renaming them (old "0.log" becomes "1.log" and so on). This setting controls, how many of these old logs will be kept.

Logfile-lines to view:

This setting controls, how many logfile-lines are kept in memory and are accessible on the main window. This is only a "performance"-issue, as the update of the displayed list will take some time.

Save/View (Errors/Warnings/System/Info/Detail/Debug/Full):

These settings control, which types of Hamster-messages are saved in the log-files ("Save") and which types are displayed in the main windows ("View").

Use "[X] Debug" only to get all details when you have any communication-problems and reset it afterwards, as this settings needs much space on disk (my "Highscore" is about 0,5 GB ... ;-).


Configuration, Online-Menu
Menu: File / Configuration / Online-Menu

Menu-item:

There are 9 definable items in the "Online"-menu. Each item defines a list of servers, which are "used", when the item is selected.

Title:

The text to display in the "Online"-menu.

Available / Selected servers:

Here you can select the servers to use from the list of defined news- and mailservers.

To select a server, mark it in the left list and move it to the right with [-->].

To unselect a server, mark it in the right list and move it to the left with [<--].

To save your changes, press [Save].

Examples:

"News"	-->  select all NNTP-servers.

"Receive Mail"	-->  select all POP3-servers.

"Send Mail"	-->  select all SMTP-servers.

"MyProvider-only"	-->  select all "MyProvider"-servers.


Scorefile, Log
Menu: File / Killfile-Log

The killfile-log displays the overview-information of articles, which were not loaded due to scorefile-entries.

By clicking on one of the column-headers (Server, Group, Score, ...), the list will be sorted based on the values of this column. Identical values in this column will be sorted by up to two additional fields, which you can select with menu "File / Set sort-sequence..." (e.g. when sorting by "Group", a good sequence might be "Group, Subject, Date").

If you double-click a line with the left mouse-button, all available infos for the article are displayed.

The context-menu of the list (right-click above displayed lines) gives additional functions for the selected lines:

Select all:

Selects all lines, either for marking or deleting (see below).

Mark for retrieval:

Message-IDs of all selected articles are saved in file ".\Server\(servername)\getmids.txt". These articles will be loaded within next online-session for this server.

Delete...:

Deletes all selected entries.

Scorefile-Test:

The selected article is tested with the current scorefile. The function shows the resulting scorevalue and the list of matching score-lines.


Scorefile, Settings
Menu: File / Killfile-Settings

A (very simple) editor for the News-Scorefile (see: "File: Scores.hst").

Don't log articles if score is lower than: _____

If a final score-value is lower than the given value, the (unloaded) article is not logged in Killfile-Log.


File, Rebuild global lists
Menu: File / Rebuild global lists

Builds the following lists immediately (normally, they are only build automatically when starting Hamster):

List of available news-pulls (.\Server\allpulls.txt):

This list contains all groups of all active newsservers including their descriptions. This is the list you can search in and select from when adding new "News-Pulls" and option "[X] Descriptions" is marked.

List of all newsgroup-descriptions (.\Server\alldescs.txt)

This list contains the descriptions of all groups. When adding a new "News-Pull", the description of the new group is loaded from this list.


File, Purge all groups
Menu: File / Purge all groups

When selecting this function, old articles, history-entries and entries in the killfile-log will be deleted and the according files will be compacted.

The duration for keeping data can be defined under "Menu: File / Configuration / Settings".


File, Rebuild history
Menu: File / Rebuild history

When selecting this menu-item, the history-file (".\Groups\History.dat") is deleted and rebuild by adding the Message-IDs of all articles stored in Hamster. Warning: This may take some time with thousands of articles.

Normally, there should be no need to start this menu-item, as history-entries are added and deleted automatically. If you have any problems with articles loaded more than once, you might try this function.


File, Clear counters+logs
Menu: File / Clear counters+log

Resets the counters in the status-line and clears current logfile-display.


File, Refresh menu items
Menu: File / Refresh menu items

Refreshes the dynamically added menu items (i.e. server groups and single servers in Online-menu and available scripts in Script-menu).


Online, 1-9: ???
Menu: Online / 1-9: ???

You can define up to 9 menu-items at "Menu: File / Configuration / Online-Menu".

When you select one of these items, transfer to/from the selected server starts.


Online, All servers (News+Mail)
Menu: Online / All servers (News+Mail)

This menu-items starts transfer from/to all defined news- and mailservers.

If you want to restrict transfer to specific servers (e.g. only newsserver), you have to use one of the definable menu-items.


Menu Script
Menu: Script

Script / (available script files)

Starts one of the available script files (*.hsc).

Please note, that all scriptfiles starting with "Demo-" are disabled and can't be started. These scripts are delivered with Hamster and would be overwritten when installing a new version of Hamster.

Script / Edit

Starts an editor with one of the available scripts (*.hsc).

By default, the Windows editor "notepad.exe" is used, but this can be changed with the "editor.*"-settings in file Hamster.ini.

Script / Edit Modules

Starts an editor with one of the available script-modules (*.hsm).

By default, the Windows editor "notepad.exe" is used, but this can be changed with the "editor.*"-settings in file Hamster.ini.

Script / Stop all scripts

Stops all currently running scripts.


Online, Stop all tasks
Menu: Online / Stop all tasks

When selecting this menu-item, Hamster tries to stop all running tasks.

Yes, I really mean "tries to" ... ;-)


Local, Start/Stop Newsserver (NNTP)
Menu: Local / Start/Stop Newsserver (NNTP)

If this menu-item is marked, the local newsserver (NNTP) is currently running. This means, that you can pull news from and post news to Hamster with your newsreader.

When you select the menu-item, the server will be stopped, if it's running or will be started, if it's stopped.

To automatically start the server when Hamster is loaded, you can activate this under "Menu: File / Configuration / Settings".


Local, Start/Stop Mailserver (POP3)
Menu: Local / Start/Stop Mailserver (POP3)

If this menu-item is marked, the local mailserver (POP3) is currently running. This means, that you can pull mails from Hamster with your mailprogram.

When you select the menu-item, the server will be stopped, if it's running or will be started, if it's stopped.

To automatically start the server when Hamster is loaded, you can activate this under "Menu: File / Configuration / Settings".


Local, Start/Stop Mailserver (SMTP)
Menu: Local / Start/Stop Mailserver (SMTP)

If this menu-item is marked, the local mailserver (SMTP) is currently running. This means, that you can send mails to Hamster with your mailprogram.

When you select the menu-item, the server will be stopped, if it's running or will be started, if it's stopped.

To automatically start the server when Hamster is loaded, you can activate this under "Menu: File / Configuration / Settings".


Hamster-Scripts
Hamster-Scripts (*.hsc)

Please note:

These old-style scripts will be removed in a future version. It is suggested

not to use them any more and to use the new-style scripts instead.

Purpose:

The built-in Hamster-Scripts provide an easy-to-use method for starting common tasks.

Commands:

quit

Stops execution of script.

restart

Restarts script from beginning.

call "scriptname.hsc"

Loads and executes the given script. After the sub-script has finished, the parent script is continued after the "call"-line.

wait.delay milliseconds

Waits the given amount of milliseconds (1/1000 seconds).

Example:  wait.delay 5000

wait.until timepoint1 timepoint2 timepoint3 ...

Waits until one of the given timepoints. The timepoints have to be in format "hh.mm".

Example: wait.until 02.00 08.00 12.00 18.00 21.00

wait.idle

Waits until all active tasks (like purging, pulling news, sending mails etc.) have finished.

Example: wait.idle

mail.pull ["ServerList"]

Starts the thread, which first fetches new mails from the mailservers and then sends out mails (if any).

If you omit ServerList or set it to an empty string (""), all POP3- and SMTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers.

If used, the ServerList has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port).

Example:  mail.pull

Example:  mail.pull "mail.aaa.com,pop3;mail.bbb.com,pop3;mail.aaa.com,smtp"

fetchmail Server Port User Pass DestUser

Starts a thread, which fetches mails from the given POP3-server (Server, Port).

If User and Pass are given, they will be used to login to the server, if they are both empty, the password-setting for the given server is used. Furthermore, one of the stored "general-purpose"-passwords can be used here to avoid noting it in clear-text in the script (User="$(number)", Pass="").

If DestUser is given, fetched mails will be stored in the mailbox of this user, "admin"-mailbox is used otherwise. The name may optionally be followed by a comma and an identifier, which determines the filter-section to use for the mails fetched with this commands (default is global filters only, i.e. "[*]"-section in MailfFilt.hst).

Examples:

 fetchmail "pop3.serv.er" "" "" "" ""

 fetchmail "pop3.serv.er" "pop3" "john.doe" "secret" "john"

 fetchmail "pop3.serv.er" "10110" "$7" "" "jane"

 fetchmail "pop3.serv.er" "pop3" "$7" "" "admin,myfilters"

sendmail Server Port FromSelection

Starts a thread, which sends mails to the given SMTP-server (Server, Port).

If no FromSelection is given, all mails waiting for delivery are sent. If a selection is given (regular expression), only mails with a matching Envelope-From are sent to this server.

Examples:

 sendmail "smtp1.serv.er" "smtp" "john\.doe@serv\.er"

 sendmail "smtp2.serv.er" "" ""

news.post ["ServerList"]

Starts the thread, which posts new articles (if any).

If ServerList is set to an empty string (""), all NNTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers (see mail.pull for details on the ServerList-format).

news.pull ["Serverlist"]

Starts the threads, which pull new articles from newsservers.

If ServerList is set to an empty string (""), all NNTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers (see mail.pull for details on the ServerList-format).

news.purge [PurgeOptions]

Starts a purge-thread (i.e. the deletion of old data).

The bit-oriented parameter PurgeOptions describes, which old data should be deleted (bit0=1=articles, bit1=2=history-entries, bit2=4=killfile-log, bit3=8=mailhistory-entries). If you omit this value, all types of old data will be "purged".

Example:  news.purge

Example:  news.purge 15

news.rebuildhistory

Starts a thread, which deletes the current history-file (".\Groups\History.dat") and rebuilds it by adding the Message-IDs of all articles stored in Hamster.

Note: This may take some time with thousands of articles, so it should only be used, if it's really necessary! Be sure to wait until Hamster is idle again (wait.idle) after calling this function!

news.rebuildgloballists

Starts a thread, which rebuilds some lists needed by Hamster (see "Menu: File / Rebuild global lists" for details).

setlogin "Identifier" "Username" "Password"

Temporarily sets username and password for the given Identifier, which can be either the name of a RAS-connection or the name of a news-/mail-server. "Temporarily" means, that this setting is not saved to a file but is kept in memory until Hamster is closed again.

If username and/or password is set to a single question-mark ("?"), Hamster will ask for the value when it's needed.

Furthermore, one of the stored "general-purpose"-passwords can be selected here to avoid noting it in clear-text in the script.

Example: setlogin "RAS-connection" "DoeJohn" "Secret!"

Example: setlogin "news.xxx.com" "DoeJane" "42"

Example: setlogin "ser.verna.me" "$11" ""

ras.dial "ConnectionID" ["Username" ["Password"]]

This function establishes the RAS-connection named ConnectionID.

The username and/or password can be set to empty strings (""). In this case, the setlogin-setting (if any) or the values stored in Hamster are used to establish the connection.

If dialing fails, the script will be stopped.

Example: ras.dial "RAS-connection" "DoeJohn" "Secret!"

Example: ras.dial "RAS-connection"

ras.hangup

Closes the RAS-connection established by rasdial.

Example: ras.hangup

msgbox "message"

Displays the given message.

Example: msgbox "Script finished!"

start.wait "command and parameters"

Starts an external program with the given parameters. The script is paused until the external program has finished.

Example: start.wait "before-dial.bat"

start.nowait "command and parameters"

Like start.wait, but Hamster does not wait until the external program has finished. The script is continued immediately.

Example: start.nowait "after-connected.bat"

message msg-number [parameter]

Initiates some Hamster-functions, which are normally available and accessed by its menu-items.

msg-number	parameter	purpose
1	none	Exit Hamster
2	none	Reset counters and log-display
3	0=stop, 1=start	Start/Stop local NNTP-server
4	0=stop, 1=start	Start/Stop local POP3-server
5	0=stop, 1=start	Start/Stop local SMTP-server
6	0=hide, 1=show	Hide/show main-window
7	0=hide, 1=show	Hide/show tray-icon
8	none	Menu: Online/Stop all tasks

Example:  message 2

Example:  message 3 0

Example:

wait.idle

# purge

# wait.idle

ras.dial "name of ras-connection"

mail.pull

news.post

wait.idle

news.pull

wait.idle

ras.hangup


Hamster-Event-objects (Win32)

Purpose:

Hamster provides an event-object named "evtHamster.IsIdle", which is in signaled state, when there are no active tasks, and in unsignaled state, when there are active tasks (like purge, pulling news etc.).

After starting tasks in Hamster, you can use this event-object to wait until Hamster has finished all these tasks. The advantage of this wait-approach is, that your application is suspended (i.e. does not consume processor-time) until the event is signaled again.

Note: Client-connections to local servers do not count as an "active task" here.

Examples:

Perl:

use Win32::Event;

$evtHamsterIsIdle = Win32::Event->open("evtHamster.IsIdle");

# start Hamster-tasks

$evtHamsterIsIdle->wait();

Visual Basic:

Private Const INFINITE = &HFFFF

Private Const SYNCHRONIZE = &H100000

Private Declare Function OpenEvent Lib "kernel32" Alias "OpenEventA" _

        (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _

        ByVal lpName As String) As Long

Private Declare Function WaitForSingleObject Lib "kernel32" _

        (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

Private Declare Function CloseHandle Lib "kernel32" _

        (ByVal hObject As Long) As Long

Dim evtHamsterIsIdle As Long, res As Long

evtHamsterIsIdle = OpenEvent(SYNCHRONIZE, False, "evtHamster.IsIdle")

' start Hamster-tasks

res = WaitForSingleObject(evtHamsterIsIdle, INFINITE)

res = CloseHandle(evtHamsterIsIdle)

Delphi 3:

uses Windows;

var evtHamsterIsIdle: THandle;

evtHamsterIsIdle := OpenEvent( SYNCHRONIZE, False, 'evtHamster.IsIdle' );

// start Hamster-tasks

WaitForSingleObject( evtHamsterIsIdle, INFINITE );

CloseHandle( hdlEvent );


Hamster-Mutex-objects (Win32)

Purpose:

The mutex-object "mutexHamster.App.*" is used to prevent additional instances of Hamster from running in the same path. It is locked when a Hamster-instance is started and released when it is closed again. If the mutex can't be locked on startup, the additional instance will not start.

It may also be used to test, if a given Hamster is already running.

Format:

"mutexHamster.App." + (full path to Hamster.exe)

The path- and filename is converted to lowercase and all characters except "a"-"z" and "0"-"9" are replaced by "_".

Example:

Program:	 C:\Program Files\News\Hamster.exe

Mutex-name:	 mutexHamster.App.c__program_files_news_hamster_exe

Program:	 \\Server\C$\News\Hamster.exe

Mutex-name:	 mutexHamster.App.__server_c__news_hamster_exe


Automation (OLE)

Use Hamster's automation-server:

To use Hamster by automation (OLE), create an automation-object with classname "Hamster.App".

Examples:

Perl:

use Win32::OLE;

my $Hamster = Win32::OLE->new("Hamster.App");

print $Hamster->ControlGetInfo;

undef $Hamster;

VBScript (Windows Script Host):

Set Hamster = Wscript.CreateObject( "Hamster.App" )

Wscript.Echo Hamster.ControlGetInfo

Wscript.DisconnectObject Hamster

Visual Basic:

Dim Hamster as Object

Set Hamster = CreateObject( "Hamster.App" )

MsgBox Hamster.ControlGetInfo

Set Hamster = Nothing

Delphi 3:

use comobj;

var Hamster: Variant;

Hamster := CreateOleObject( 'Hamster.App' );

writeln( Hamster.ControlGetInfo );

Hamster := Unassigned;

.misc-functions:

ControlGetInfo: String

Retrieves a line of text containing the Hamster-version and -path (for "Hello World!"-purposes ...).

ControlGetPath: String

Retrieves the path of the currently registered und used automation-server (i.e. path to last used "Hamster.exe")

ControlGetVersion: String

Retrieves the Hamster-versionnumber as a string ("1.3.0.16").

ControlSetLogin(Identifier, Username, Password: String)

Temporarily sets username and password for the given identifier, which can be either the name of a RAS-connection or the name of a news-/mail-server. "Temporarily" means, that this setting is not saved to a file but is kept in memory until Hamster is closed again.

If username and/or password is set to a single question-mark ("?"), Hamster will ask for the value when it's needed.

Furthermore, one of the stored "general-purpose"-passwords can be selected here to avoid noting it in clear-text in the script, e.g. ControlSetLogin("serv.er", "$1", "").

ControlMessage(Msg, Param: Integer): Integer

HAM_MSG_HAMSTER_EXIT    = 1

HAM_MSG_RESET_COUNTERS  = 2

HAM_MSG_LOCALNNTP_ONOFF = 3

HAM_MSG_LOCALPOP3_ONOFF = 4

HAM_MSG_LOCALSMTP_ONOFF = 5

HAM_MSG_SHOWWINDOW      = 6

HAM_MSG_SHOWICON        = 7

HAM_MSG_STOPALLTASKS    = 8

Initiates some Hamster-functions, which are normally available and accessed by menu-items.

Msg	Param	purpose
1	ignored	Exit Hamster
2	ignored	Reset counters and log
3	0=stop, 1=start	Start/Stop local NNTP-server
4	0=stop, 1=start	Start/Stop local POP3-server
5	0=stop, 1=start	Start/Stop local SMTP-server
6	0=hide, 1=show	Hide/show main-window
7	0=hide, 1=show	Hide/show tray-icon
8	ignored	Menu: Online/Stop all tasks

Return-values:

0	OK; command executed.
1	Error; command failed.
2	Unknown Msg-number.
3	GPF, please reboot ... ;-)

Task-functions:

ControlIsIdle: Bool

Returns TRUE if there are currently no active tasks like purging, pulling news, sending mails etc.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

ControlWaitIdle(WaitTimeout: Integer): Bool

Const HAM_WAITIDLE_INFINITE = 0

Like ControlIsIdle above, but this functions additionally waits the given amount of milliseconds, if there are active tasks. When called with WaitTimeout=0, the function does not return until all tasks have finished.

Note: See "Events: evtHamster.IsIdleAgain" for a better approach to wait until Hamster becomes "idle" again.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

ControlThreadCount: Integer

Gives the number of currently active tasks.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

ControlFlush: Integer

Writes unsaved data to disk. Suggested after last article imported with NewsImport.

ControlRunPurge(PurgeOptions: Integer): Integer

Const HAM_PURGEOPT_DOALL      = 0xFF

Const HAM_PURGEOPT_DONEWS     = 0x01

Const HAM_PURGEOPT_DOHISTORY  = 0x02

Const HAM_PURGEOPT_DOKILLS    = 0x04

Const HAM_PURGEOPT_DOMHISTORY = 0x08

Starts a purge-thread (i.e. the deletion of old data). The bit-oriented parameter PurgeOptions describes, which old data should be deleted (bit0=1=articles, bit1=2=history-entries, bit2=4=killfile-log, bit3=8=mailhistory-entries).

ControlRunRebuildHistory: Integer

Starts a thread, which deletes the current history-file (".\Groups\History.dat") and rebuilds it by adding the Message-IDs of all articles stored in Hamster.

Note: This may take some time with thousands of articles, so it should only be used, if it's really necessary! Be sure to wait until Hamster is idle again (e.g. with ControlWaitIdle) after calling this function!

ControlRunRebuildGlobalLists( Options: Integer ): Integer

Starts a thread, which rebuilds some lists needed by Hamster (see "Menu: File / Rebuild global lists" for details). No Options yet, so always use 0.

ControlRunMail(ServerList: String): Integer

Starts the thread, which first fetches new mails from the mailservers and then sends out mails (if any).

If ServerList is set to an empty string (""), all POP3- and SMTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers.

If used, the ServerList has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port).

Example: "mail.aaa.com,pop3;mail.bbb.com,pop3;mail.aaa.com,smtp"

ControlRunFetchMail(Server, Port, User, Pass, DestUser: String): Integer

Starts a thread, which fetches mails from the given POP3-server (Server, Port).

If User and Pass are given, they will be used to login to the server, if they are both empty, the password-setting for the given server is used. Furthermore, one of the stored "general-purpose"-passwords can be used here to avoid noting it in clear-text in the script (User="$(number)", Pass="").

If DestUser is given, fetched mails will be stored in the mailbox of this user, "admin"-mailbox is used otherwise. The name may optionally be followed by a comma and an identifier, which determines the filter-section to use for the mails fetched with this commands (default is global filters only, i.e. "[*]"-section in MailfFilt.hst).

Examples:

 ControlRunFetchMail( "pop3.serv.er", "pop3", "", "", "" )

 ControlRunFetchMail( "pop3.serv.er", "", "john.doe", "secret", "john" )

 ControlRunFetchMail( "pop3.serv.er", "10110", "$7", "", "jane" )

 ControlRunFetchMail( "pop3.serv.er", "", "$7", "", "admin,myfilters" )

ControlRunSendMail(Server, Port, FromSelection: String): Integer

Starts a thread, which sends mails to the given SMTP-server (Server, Port).

If no FromSelection is given, all mails waiting for delivery are sent. If a selection is given (regular expression), only mails with a matching Envelope-From are sent to this server.

Examples:

 ControlRunSendMail( "smtp1.serv.er", "smtp", "john\.doe@serv\.er" )

 ControlRunSendMail( "smtp2.serv.er", "", "" )

ControlRunSendMailAuth(Server, Port, User, Pass, FromSelection: String): Integer

Like ControlRunSendMail above, but additionally allows to provide username and password used for authentication.

Note: Username and password are ignored, if SMTP authentication is not enabled for the given server (see notes on SMTP authentication under "Mailserver").

Example:

 ControlRunSendMailAuth( "smtp3.serv.er", "smtp", "$42", "", "@smtp3.serv.er" )

ControlRunNewsPost(ServerList: String): Integer

Starts the thread, which posts new articles (if any).

If ServerList is set to an empty string (""), all NNTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers (see ControlRunMail for details on the ServerList-format).

Note: Starting with Hamster Vr. 1.3.19, this function was replaced with the NewsJobs*-functions described below and is only simulated internally with these new functions. See the example at "NewsJobsStart" for a replacement of this obsolete function.

ControlRunNewsPull(ServerList: String): Integer

Starts the threads, which pull new articles from newsservers.

If ServerList is set to an empty string (""), all NNTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers (see ControlRunMail for details on the ServerList-format).

Note: Starting with Hamster Vr. 1.3.19, this function was replaced with the NewsJobs*-functions described below and is only simulated internally with these new functions. See the example at "NewsJobsStart" for a replacement of this obsolete function.

NewsJobsClear: Integer

NewsJobsPullDef(ServerList: String): Integer

NewsJobsPostDef(ServerList: String): Integer

NewsJobsPull(Servername, reGrpSelect: String): Integer

NewsJobsPost(Servername, reGrpSelect, reMsgSelect: String): Integer

NewsJobsStart(ServerList: String): Integer

These functions are identical to those used in Hamster-scripts.

For details, see the descriptions at:

HamNewsJobsClear, HamNewsJobsPullDef, HamNewsJobsPostDef, HamNewsJobsPull, HamNewsJobsPost, HamNewsJobsStart.

RAS-functions:

RasDial(ConnectionID, Username, Password: String): Bool

This function establishes the RAS-connection named ConnectionID.

The username and/or password can be set to empty strings (""). In this case, the ControlSetLogin-setting (if any) or the values stored in Hamster are used to establish the connection.

If dialing was successful (i.e. a connection was established), the function returns TRUE, otherwise FALSE (use RasLastError to get additional information on the failure).

RasHangup

Closes the current RAS-connection, even if not established by RasDial.

RasIsConnected: Bool

Returns TRUE, if there's a valid RAS-connection established by RasDial.

RasLastError: Integer

Returns the last RAS-errorcode (especially when RasDial returned FALSE).

News-functions:

NewsGrpCount: Integer

Retrieves number of newsgroups available from Hamster.

NewsGrpName(GrpIdx: Integer): String

Retrieves the name of the given newsgroup. GrpIdx can be 0 to (NewsGrpCount-1).

NewsGrpIndex(GrpName: String): Integer

Retrieves the index-number of the given groupname (-1 for unknown groups).

NewsGrpOpen(GrpName: String): Integer

Opens the given group and returns a handle (>=0), which is needed to retrieve additional infos in the functions below (the handle is referenced as GrpHdl there).
If the function fails, the return-value is negative (<0).

NewsGrpClose(GrpHdl: Integer)

Close a previously opened group.

NewsArtCount(GrpHdl: Integer): Integer

Retrieves the number of available articles in the group.

NewsArtNoMin(GrpHdl: Integer): Integer

Retrieve the lowest available article-number.

NewsArtNoMax(GrpHdl: Integer): Integer

Retrieve the highest available article-number.

NewsArtText(GrpHdl, ArtNo: Integer): String

Retrieves the text for the given article-number. An empty string indicates, that the article is not available any more.

NewsArtTextExport(GrpHdl, ArtNo: Integer): String

Same as NewsArtText, but the text is converted to export-format.

NewsScoreListFor(GrpName: String): String

Retrieves a list containing all score-entries, which will be used when pulling news for the given groupname.

NewsScoreTest(GrpName, ArtText: String; var MatchLog: String): Integer;

Returns the scorevalue for the given article (ArtText). The test is done with the assumption, that the article was pulled from the given newsgroup (GrpName). A CR/LF-separated list of all matching scorelines is returned in MatchLog.

NewsLocateMID(MessageID: String; var Groupname: String; var ArtNo: Integer): Bool;

Returns TRUE, if the given Message-ID is [still] saved in the history-file. In this case, Groupname and Article-number will be set to point to this article.
Otherwise the function returns FALSE and Groupname and article-number remain unchanged.

NewsLocateMID2(MessageID: String; var Groupname: Variant; var ArtNo: Variant): Bool;

Same as "NewsLocateMid" above, but with Variant-parameters. Use this version in VBScript-scripts (Windows Script Host).

NewsDeleteByMID(MessageID: String): Bool;

Locates the article identified by the given Message-ID and deletes it in Hamster's database-files. The function returns TRUE, if article could be located and deleted; FALSE otherwise.

NewsImport(ArtText, OverrideGroups: String; IgnoreHistory, MarkNoArchive: Bool): Bool;

Imports the given article into Hamster's database and returns TRUE, if the article was imported, FALSE otherwise.
ArtText contains the article to import, including all headers, header/body-separator and the article-body. The lines have to be separated by CR+LF (0x0d, 0x0a).
If OverrideGroups is empty, the article is stored in the groups determined by the "Newsgroups:"-header of the article. Otherwise it is stored in the group given by OverrideGroups. If no valid local groups are given, the article is stored in hamster.misc.
If IgnoreHistory is TRUE, no history-lookup is made for the Message-ID of the imported article, so it will be imported even if it's already known.
If MarkNoArchive is TRUE, the imported article is marked with "NoArchive=1" in the "X-Hamster-Info:"-header. This flag might be used to mark the imported article as "temporary", so it can, for example, be ignored by appropriate archiving-software [not available yet ;-)].


Error-codes and -messages

Frequent error-codes and -messages

Hamster-Logfile, Hamster-Replies, WinSock-Errors

Windows Sockets (WinSock) Error Codes

Numbers: 10004 - 11004

Remote Access Service (RAS) Error Codes

Numbers: 600 - 752

Win32 - System Error Codes

Numbers: 1 - 6118

Win32 - Net Error Codes

Numbers: 2102 - 2693


Error-Codes (frequent)
Frequent error-codes and -messages

Hamster-Logfile

Start of local XXXX-server failed

The given local server could not be started, mostly due to another program which is already using the port-number, e.g. a virus-scanner for mails like "Norton's AntiVirus" (NAV), which itself works like a POP3-server.

As no two servers can use the same port-number at the same time, you have to configure one of the programs to use another port-number.

Hamster-Replies

500 Permission denied - closing connection. [local NNTP/SMTP]

-ERR Permission denied - closing connection. [local POP3]

The connecting IP-address is not permitted to access Hamster's local server. See "IPAccess.hst" for details.

500 Permission denied (not authorized by POP3). [local SMTP]

Hamster's local SMTP-server is configured to only grant access after client has authenticated itself by a successful POP3-login. See "SMTP-after-POP3" for details.

WinSock-Errors

10048 WSAEADDRINUSE

Possible reasons:

* Firewall prevents local Hamster-servers from starting.

10049 WSAEADDRNOTAVAIL

The server is known but could not be reached.

Possible reasons:

* You are/were not "online", i.e. not connected to the internet.

* Internet-connection was interrupted.

* The server is temporarily down - try again later.

10053 WSAECONNABORTED

Possible reasons:

* Internet-connection was interrupted or lost while connecting to remote server was still in progress.

10061 WSAECONNREFUSED

Possible reasons:

* The Hamster-server is not activated (see "Menu: Local / Start/Stop ...").

* The Hamster-server failed to start (restart Hamster and look out for "red" errors).

* The default port-settings for the Hamster-server and/or the newsreader/mailclient were changed and are not equal any more.

* The port-number is blocked by a firewall.

10065 WSAEHOSTUNREACH

Like 10049 above, but the connection was lost after a valid connection to the server.

10071 WSAEREMOTE

Possible reasons:

* Connection-request was refused by remote server because you are not permitted to use it with your current internet-connection, e.g. to access the server of provider X you have to dial-in to provider X.

11001 WSAHOST_NOT_FOUND

Possible reasons:

* A server with the given name could not be found - perhaps you've misspelled it.


Error-Codes (WinSock)

Windows Sockets (WinSock) Error Codes

   WSAEINTR               10004   Interrupted system call.

   WSAEBADF               10009   Bad file number.

   WSEACCES               10013   Permission denied.

   WSAEFAULT              10014   Bad address.

   WSAEINVAL              10022   Invalid argument.

   WSAEMFILE              10024   Too many open files/sockets.

   WSAEWOULDBLOCK         10035   Operation would block.

   WSAEINPROGRESS         10036   Operation now in progress. This error is

                                  returned if any Windows Sockets API

                                  function is called while a blocking

                                  function is in progress.

   WSAEALREADY            10037   Operation already in progress.

   WSAENOTSOCK            10038   Socket operation on nonsocket.

   WSAEDESTADDRREQ        10039   Destination address required.

   WSAEMSGSIZE            10040   Message too long.

   WSAEPROTOTYPE          10041   Protocol wrong type for socket.

   WSAENOPROTOOPT         10042   Protocol not available/bad protocol option.

   WSAEPROTONOSUPPORT     10043   Protocol not supported.

   WSAESOCKTNOSUPPORT     10044   Socket type not supported.

   WSAEOPNOTSUPP          10045   Operation not supported on socket.

   WSAEPFNOSUPPORT        10046   Protocol family not supported.

   WSAEAFNOSUPPORT        10047   Address family not supported by protocol

                                  family.

   WSAEADDRINUSE          10048   Address already in use.

   WSAEADDRNOTAVAIL       10049   Cannot assign requested address.

   WSAENETDOWN            10050   Network is down. This error may be

                                  reported at any time if the Windows

                                  Sockets implementation detects an

                                  underlying failure.

   WSAENETUNREACH         10051   Network is unreachable.

   WSAENETRESET           10052   Network dropped connection on reset.

   WSAECONNABORTED        10053   Software caused connection abort.

   WSAECONNRESET          10054   Connection reset by peer.

   WSAENOBUFS             10055   No buffer space available.

   WSAEISCONN             10056   Socket is already connected.

   WSAENOTCONN            10057   Socket is not connected.

   WSAESHUTDOWN           10058   Cannot send after socket shutdown.

   WSAETOOMANYREFS        10059   Too many references: cannot splice.

   WSAETIMEDOUT           10060   Connection timed out.

   WSAECONNREFUSED        10061   Connection refused.

   WSAELOOP               10062   Too many levels of symbolic links.

   WSAENAMETOOLONG        10063   File name too long.

   WSAEHOSTDOWN           10064   Host is down.

   WSAEHOSTUNREACH        10065   No route to host.

   WSAENOTEMPTY           10066   Directory not empty.

   WSAEPROCLIM            10067   Too many processes.

   WSAEUSERS              10068   Too many users.

   WSAEDQUOT              10069   Disc quota exceeded.

   WSAESTALE              10070   Stale NFS file handle

   WSAEREMOTE             10071   Too many levels of remote in path.

   WSASYSNOTREADY         10091   Network subsystem is unavailable.

   WSAVERNOTSUPPORTED     10092   Winsock version not supported.

   WSANOTINITIALISED      10093   Winsock not yet initialized.

   WSAEDISCON             10101   Graceful disconnect in progress.

   WSAENOMORE             10102   - (Winsock2)

   WSAECANCELLED          10103   - (Winsock2)

   WSAEINVALIDPROCTABLE   10104   - (Winsock2)

   WSAEINVALIDPROVIDER    10105   - (Winsock2)

   WSAEPROVIDERFAILEDINIT 10106   - (Winsock2)

   WSASYSCALLFAILURE      10107   System call failure. (WS2)

   WSASERVICE_NOT_FOUND   10108   - (Winsock2)

   WSATYPE_NOT_FOUND      10109   - (Winsock2)

   WSA_E_NO_MORE          10110   - (Winsock2)

   WSA_E_CANCELLED        10111   - (Winsock2)

   WSAEREFUSED            10112   - (Winsock2)

   WSAHOST_NOT_FOUND      11001   Host not found. This message indicates

                                  that the key (name, address, and so on)

                                  was not found.

   WSATRY_AGAIN           11002   Non-authoritative host not found. This

                                  error may suggest that the name service

                                  itself is not functioning.

   WSANO_RECOVERY         11003   Non-recoverable error. This error may

                                  suggest that the name service itself is

                                  not functioning.

   WSANO_DATA             11004   Valid name, no data record of requested

                                  type. This error indicates that the key

                                  (name, address, and so on) was not found.

   WSA_NOT_ENOUGH_MEMORY          Insufficient memory available

   WSA_OPERATION_ABORTED          Overlapped operation aborted

   WSA_IO_INCOMPLETE              Overlapped I/O object not signalled

   WSA_IO_PENDING                 Overlapped I/O will complete later

   WSA_INVALID_PARAMETER          One or more parameters are invalid

   WSA_INVALID_HANDLE             Event object handle not valid


Error-Codes (RAS)

Remote Access Service (RAS) Error Codes

600	An operation is pending.

601	The port handle is invalid.

602	The port is already open.

603	Caller's buffer is too small.

604	Wrong information specified.

605	Cannot set port information.

606	The port is not connected.

607	The event is invalid.

608	The device does not exist.

609	The device type does not exist.

610	The buffer is invalid.

611	The route is not available.

612	The route is not allocated.

613	Invalid compression specified.

614	Out of buffers.

615	The port was not found.

616	An asynchronous request is pending.

617	The port or device is already disconnecting.

618	The port is not open.

619	The port is disconnected.

620	There are no endpoints.

621	Cannot open the phone book file.

622	Cannot load the phone book file.

623	Cannot find the phone book entry.

624	Cannot write the phone book file.

625	Invalid information found in the phone book.

626	Cannot load a string.

627	Cannot find key.

628	The port was disconnected.

629	The port was disconnected by the remote machine.

630	The port was disconnected due to hardware failure.

631	The port was disconnected by the user.

632	The structure size is incorrect.

633	The port is already in use or is not configured for Remote Access dialout.

634	Cannot register your computer on the remote network.

635	Unknown error.

636	The wrong device is attached to the port.

637	The string could not be converted.

638	The request has timed out.

639	No asynchronous net available.

640	A NetBIOS error has occurred.

641	The server cannot allocate NetBIOS resources needed to support the client.

642	One of your NetBIOS names is already registered on the remote network.

643	A network adapter at the server failed.

644	You will not receive network message popups.

645	Internal authentication error.

646	The account is not permitted to log on at this time of day.

647	The account is disabled.

648	The password has expired.

649	The account does not have Remote Access permission.

650	The Remote Access server is not responding.

651	Your modem (or other connecting device) has reported an error.

652	Unrecognized response from the device.

653	A macro required by the device was not found in the device .INF file section.

654	A command or response in the device .INF file section refers to an undefined macro

655	The <message> macro was not found in the device .INF file section.

656	The <defaultoff> macro in the device .INF file section contains an undefined macro

657	The device .INF file could not be opened.

658	The device name in the device .INF or media .INI file is too long.

659	The media .INI file refers to an unknown device name.

660	The device .INF file contains no responses for the command.

661	The device .INF file is missing a command.

662	Attempted to set a macro not listed in device .INF file section.

663	The media .INI file refers to an unknown device type.

664	Cannot allocate memory.

665	The port is not configured for Remote Access.

666	Your modem (or other connecting device) is not functioning.

667	Cannot read the media .INI file.

668	The connection dropped.

669	The usage parameter in the media .INI file is invalid.

670	Cannot read the section name from the media .INI file.

671	Cannot read the device type from the media .INI file.

672	Cannot read the device name from the media .INI file.

673	Cannot read the usage from the media .INI file.

674	Cannot read the maximum connection BPS rate from the media .INI file.

675	Cannot read the maximum carrier BPS rate from the media .INI file.

676	The line is busy.

677	A person answered instead of a modem.

678	There is no answer.

679	Cannot detect carrier.

680	There is no dial tone.

681	General error reported by device.

682	ERROR WRITING SECTIONNAME

683	ERROR WRITING DEVICETYPE

684	ERROR WRITING DEVICENAME

685	ERROR WRITING MAXCONNECTBPS

686	ERROR WRITING MAXCARRIERBPS

687	ERROR WRITING USAGE

688	ERROR WRITING DEFAULTOFF

689	ERROR READING DEFAULTOFF

690	ERROR EMPTY INI FILE

691	Access denied because username and/or password is invalid on the domain.

692	Hardware failure in port or attached device.

693	ERROR NOT BINARY MACRO

694	ERROR DCB NOT FOUND

695	ERROR STATE MACHINES NOT STARTED

696	ERROR STATE MACHINES ALREADY STARTED

697	ERROR PARTIAL RESPONSE LOOPING

698	A response keyname in the device .INF file is not in the expected format.

699	The device response caused buffer overflow.

700	The expanded command in the device .INF file is too long.

701	The device moved to a BPS rate not supported by the COM driver.

702	Device response received when none expected.

703	ERROR INTERACTIVE MODE

704	ERROR BAD CALLBACK NUMBER

705	ERROR INVALID AUTH STATE

706	ERROR WRITING INITBPS

707	X.25 diagnostic indication.

708	The account has expired.

709	Error changing password on domain.

710	Serial overrun errors were detected while communicating with your modem.

711	RasMan initialization failure. Check the event log.

712	Biplex port is initializing. Wait a few seconds and redial.

713	No active ISDN lines are available.

714	Not enough ISDN channels are available to make the call.

715	Too many errors occurred because of poor phone line quality.

716	The Remote Access IP configuration is unusable.

717	No IP addresses are available in the static pool of Remote Access IP addresses.

718	PPP timeout.

719	PPP terminated by remote machine.

720	No PPP control protocols configured.

721	Remote PPP peer is not responding.

722	The PPP packet is invalid.

723	The phone number, including prefix and suffix, is too long.

724	The IPX protocol cannot dial-out on the port because the computer is an IPX router.

725	The IPX protocol cannot dial-in on the port because the IPX router is not installed..

726	The IPX protocol cannot be used for dial-out on more than one port at a time.

727	Cannot access TCPCFG.DLL.

728	Cannot find an IP adapter bound to Remote Access.

729	SLIP cannot be used unless the IP protocol is installed.

730	Computer registration is not complete.

731	The protocol is not configured.

732	The PPP negotiation is not converging.

733	The PPP control protocol for this network protocol is not available on the server.

734	The PPP link control protocol terminated..

735	The requested address was rejected by the server..

736	The remote computer terminated the control protocol.

737	Loopback detected..

738	The server did not assign an address.

739	The remote server cannot use the Windows NT encrypted password.

740	The TAPI devices configured for Remote Access failed to initialize or were not installed correctly.

741	The local computer does not support encryption.

742	The remote server does not support encryption.

743	The remote server requires encryption.

744	Cannot use the IPX net number assigned by the remote server. Check the event log.

752	A syntax error was encountered while processing a script.


Error-Codes (Win32-System)

Win32 - System Error Codes

0	The operation completed successfully. ERROR_SUCCESS

1	Incorrect function. ERROR_INVALID_FUNCTION

2	The system cannot find the file specified. ERROR_FILE_NOT_FOUND

3	The system cannot find the path specified. ERROR_PATH_NOT_FOUND

4	The system cannot open the file. ERROR_TOO_MANY_OPEN_FILES

5	Access is denied. ERROR_ACCESS_DENIED

6	The handle is invalid. ERROR_INVALID_HANDLE

7	The storage control blocks were destroyed. ERROR_ARENA_TRASHED

8	Not enough storage is available to process this command. ERROR_NOT_ENOUGH_MEMORY

9	The storage control block address is invalid. ERROR_INVALID_BLOCK

10	The environment is incorrect. ERROR_BAD_ENVIRONMENT

11	An attempt was made to load a program with an incorrect format. ERROR_BAD_FORMAT

12	The access code is invalid. ERROR_INVALID_ACCESS

13	The data is invalid. ERROR_INVALID_DATA

14	Not enough storage is available to complete this operation. ERROR_OUTOFMEMORY

15	The system cannot find the drive specified. ERROR_INVALID_DRIVE

16	The directory cannot be removed. ERROR_CURRENT_DIRECTORY

17	The system cannot move the file to a different disk drive. ERROR_NOT_SAME_DEVICE

18	There are no more files. ERROR_NO_MORE_FILES

19	The media is write protected. ERROR_WRITE_PROTECT

20	The system cannot find the device specified. ERROR_BAD_UNIT

21	The device is not ready. ERROR_NOT_READY

22	The device does not recognize the command. ERROR_BAD_COMMAND

23	Data error (cyclic redundancy check). ERROR_CRC

24	The program issued a command but the command length is incorrect. ERROR_BAD_LENGTH

25	The drive cannot locate a specific area or track on the disk. ERROR_SEEK

26	The specified disk or diskette cannot be accessed. ERROR_NOT_DOS_DISK

27	The drive cannot find the sector requested. ERROR_SECTOR_NOT_FOUND

28	The printer is out of paper. ERROR_OUT_OF_PAPER

29	The system cannot write to the specified device. ERROR_WRITE_FAULT

30	The system cannot read from the specified device. ERROR_READ_FAULT

31	A device attached to the system is not functioning. ERROR_GEN_FAILURE

32	The process cannot access the file because it is being used by another process. ERROR_SHARING_VIOLATION

33	The process cannot access the file because another process has locked a portion of the file. ERROR_LOCK_VIOLATION

34	The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1. ERROR_WRONG_DISK

36	Too many files opened for sharing. ERROR_SHARING_BUFFER_EXCEEDED

38	Reached the end of the file. ERROR_HANDLE_EOF

39	The disk is full. ERROR_HANDLE_DISK_FULL

50	The network request is not supported. ERROR_NOT_SUPPORTED

51	The remote computer is not available. ERROR_REM_NOT_LIST

52	A duplicate name exists on the network. ERROR_DUP_NAME

53	The network path was not found. ERROR_BAD_NETPATH

54	The network is busy. ERROR_NETWORK_BUSY

55	The specified network resource or device is no longer available. ERROR_DEV_NOT_EXIST

56	The network BIOS command limit has been reached. ERROR_TOO_MANY_CMDS

57	A network adapter hardware error occurred. ERROR_ADAP_HDW_ERR

58	The specified server cannot perform the requested operation. ERROR_BAD_NET_RESP

59	An unexpected network error occurred. ERROR_UNEXP_NET_ERR

60	The remote adapter is not compatible. ERROR_BAD_REM_ADAP

61	The printer queue is full. ERROR_PRINTQ_FULL

62	Space to store the file waiting to be printed is not available on the server. ERROR_NO_SPOOL_SPACE

63	Your file waiting to be printed was deleted. ERROR_PRINT_CANCELLED

64	The specified network name is no longer available. ERROR_NETNAME_DELETED

65	Network access is denied. ERROR_NETWORK_ACCESS_DENIED

66	The network resource type is not correct. ERROR_BAD_DEV_TYPE

67	The network name cannot be found. ERROR_BAD_NET_NAME

68	The name limit for the local computer network adapter card was exceeded. ERROR_TOO_MANY_NAMES

69	The network BIOS session limit was exceeded. ERROR_TOO_MANY_SESS

70	The remote server has been paused or is in the process of being started. ERROR_SHARING_PAUSED

71	No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept. ERROR_REQ_NOT_ACCEP

72	The specified printer or disk device has been paused. ERROR_REDIR_PAUSED

80	The file exists. ERROR_FILE_EXISTS

82	The directory or file cannot be created. ERROR_CANNOT_MAKE

83	Fail on INT 24. ERROR_FAIL_I24

84	Storage to process this request is not available. ERROR_OUT_OF_STRUCTURES

85	The local device name is already in use. ERROR_ALREADY_ASSIGNED

86	The specified network password is not correct. ERROR_INVALID_PASSWORD

87	The parameter is incorrect. ERROR_INVALID_PARAMETER

88	A write fault occurred on the network. ERROR_NET_WRITE_FAULT

89	The system cannot start another process at this time. ERROR_NO_PROC_SLOTS

100	Cannot create another system semaphore. ERROR_TOO_MANY_SEMAPHORES

101	The exclusive semaphore is owned by another process. ERROR_EXCL_SEM_ALREADY_OWNED

102	The semaphore is set and cannot be closed. ERROR_SEM_IS_SET

103	The semaphore cannot be set again. ERROR_TOO_MANY_SEM_REQUESTS

104	Cannot request exclusive semaphores at interrupt time. ERROR_INVALID_AT_INTERRUPT_TIME

105	The previous ownership of this semaphore has ended. ERROR_SEM_OWNER_DIED

106	Insert the diskette for drive %1. ERROR_SEM_USER_LIMIT

107	The program stopped because an alternate diskette was not inserted. ERROR_DISK_CHANGE

108	The disk is in use or locked by another process. ERROR_DRIVE_LOCKED

109	The pipe has been ended. ERROR_BROKEN_PIPE

110	The system cannot open the device or file specified. ERROR_OPEN_FAILED

111	The file name is too long. ERROR_BUFFER_OVERFLOW

112	There is not enough space on the disk. ERROR_DISK_FULL

113	No more internal file identifiers available. ERROR_NO_MORE_SEARCH_HANDLES

114	The target internal file identifier is incorrect. ERROR_INVALID_TARGET_HANDLE

117	The IOCTL call made by the application program is not correct. ERROR_INVALID_CATEGORY

118	The verify-on-write switch parameter value is not correct. ERROR_INVALID_VERIFY_SWITCH

119	The system does not support the command requested. ERROR_BAD_DRIVER_LEVEL

120	This function is not supported on this system. ERROR_CALL_NOT_IMPLEMENTED

121	The semaphore timeout period has expired. ERROR_SEM_TIMEOUT

122	The data area passed to a system call is too small. ERROR_INSUFFICIENT_BUFFER

123	The filename, directory name, or volume label syntax is incorrect. ERROR_INVALID_NAME

124	The system call level is not correct. ERROR_INVALID_LEVEL

125	The disk has no volume label. ERROR_NO_VOLUME_LABEL

126	The specified module could not be found. ERROR_MOD_NOT_FOUND

127	The specified procedure could not be found. ERROR_PROC_NOT_FOUND

128	There are no child processes to wait for. ERROR_WAIT_NO_CHILDREN

129	The %1 application cannot be run in Win32 mode. ERROR_CHILD_NOT_COMPLETE

130	Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O. ERROR_DIRECT_ACCESS_HANDLE

131	An attempt was made to move the file pointer before the beginning of the file. ERROR_NEGATIVE_SEEK

132	The file pointer cannot be set on the specified device or file. ERROR_SEEK_ON_DEVICE

133	A JOIN or SUBST command cannot be used for a drive that contains previously joined drives. ERROR_IS_JOIN_TARGET

134	An attempt was made to use a JOIN or SUBST command on a drive that has already been joined. ERROR_IS_JOINED

135	An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted. ERROR_IS_SUBSTED

136	The system tried to delete the JOIN of a drive that is not joined. ERROR_NOT_JOINED

137	The system tried to delete the substitution of a drive that is not substituted. ERROR_NOT_SUBSTED

138	The system tried to join a drive to a directory on a joined drive. ERROR_JOIN_TO_JOIN

139	The system tried to substitute a drive to a directory on a substituted drive. ERROR_SUBST_TO_SUBST

140	The system tried to join a drive to a directory on a substituted drive. ERROR_JOIN_TO_SUBST

141	The system tried to SUBST a drive to a directory on a joined drive. ERROR_SUBST_TO_JOIN

142	The system cannot perform a JOIN or SUBST at this time. ERROR_BUSY_DRIVE

143	The system cannot join or substitute a drive to or for a directory on the same drive. ERROR_SAME_DRIVE

144	The directory is not a subdirectory of the root directory. ERROR_DIR_NOT_ROOT

145	The directory is not empty. ERROR_DIR_NOT_EMPTY

146	The path specified is being used in a substitute. ERROR_IS_SUBST_PATH

147	Not enough resources are available to process this command. ERROR_IS_JOIN_PATH

148	The path specified cannot be used at this time. ERROR_PATH_BUSY

149	An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute. ERROR_IS_SUBST_TARGET

150	System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed. ERROR_SYSTEM_TRACE

151	The number of specified semaphore events for DosMuxSemWait is not correct. ERROR_INVALID_EVENT_COUNT

152	DosMuxSemWait did not execute; too many semaphores are already set. ERROR_TOO_MANY_MUXWAITERS

153	The DosMuxSemWait list is not correct. ERROR_INVALID_LIST_FORMAT

154	The volume label you entered exceeds the label character limit of the target file system. ERROR_LABEL_TOO_LONG

155	Cannot create another thread. ERROR_TOO_MANY_TCBS

156	The recipient process has refused the signal. ERROR_SIGNAL_REFUSED

157	The segment is already discarded and cannot be locked. ERROR_DISCARDED

158	The segment is already unlocked. ERROR_NOT_LOCKED

159	The address for the thread ID is not correct. ERROR_BAD_THREADID_ADDR

160	The argument string passed to DosExecPgm is not correct. ERROR_BAD_ARGUMENTS

161	The specified path is invalid. ERROR_BAD_PATHNAME

162	A signal is already pending. ERROR_SIGNAL_PENDING

164	No more threads can be created in the system. ERROR_MAX_THRDS_REACHED

167	Unable to lock a region of a file. ERROR_LOCK_FAILED

170	The requested resource is in use. ERROR_BUSY

173	A lock request was not outstanding for the supplied cancel region. ERROR_CANCEL_VIOLATION

174	The file system does not support atomic changes to the lock type. ERROR_ATOMIC_LOCKS_NOT_SUPPORTED

180	The system detected a segment number that was not correct. ERROR_INVALID_SEGMENT_NUMBER

182	The operating system cannot run %1. ERROR_INVALID_ORDINAL

183	Cannot create a file when that file already exists. ERROR_ALREADY_EXISTS

186	The flag passed is not correct. ERROR_INVALID_FLAG_NUMBER

187	The specified system semaphore name was not found. ERROR_SEM_NOT_FOUND

188	The operating system cannot run %1. ERROR_INVALID_STARTING_CODESEG

189	The operating system cannot run %1. ERROR_INVALID_STACKSEG

190	The operating system cannot run %1. ERROR_INVALID_MODULETYPE

191	Cannot run %1 in Win32 mode. ERROR_INVALID_EXE_SIGNATURE

192	The operating system cannot run %1. ERROR_EXE_MARKED_INVALID

193	is not a valid Win32 application. ERROR_BAD_EXE_FORMAT

194	The operating system cannot run %1. ERROR_ITERATED_DATA_EXCEEDS_64k

195	The operating system cannot run %1. ERROR_INVALID_MINALLOCSIZE

196	The operating system cannot run this application program. ERROR_DYNLINK_FROM_INVALID_RING

197	The operating system is not presently configured to run this application. ERROR_IOPL_NOT_ENABLED

198	The operating system cannot run %1. ERROR_INVALID_SEGDPL

199	The operating system cannot run this application program. ERROR_AUTODATASEG_EXCEEDS_64k

200	The code segment cannot be greater than or equal to 64K. ERROR_RING2SEG_MUST_BE_MOVABLE

201	The operating system cannot run %1. ERROR_RELOC_CHAIN_XEEDS_SEGLIM

202	The operating system cannot run %1. ERROR_INFLOOP_IN_RELOC_CHAIN

203	The system could not find the environment option that was entered. ERROR_ENVVAR_NOT_FOUND

205	No process in the command subtree has a signal handler. ERROR_NO_SIGNAL_SENT

206	The filename or extension is too long. ERROR_FILENAME_EXCED_RANGE

207	The ring 2 stack is in use. ERROR_RING2_STACK_IN_USE

208	The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified. ERROR_META_EXPANSION_TOO_LONG

209	The signal being posted is not correct. ERROR_INVALID_SIGNAL_NUMBER

210	The signal handler cannot be set. ERROR_THREAD_1_INACTIVE

212	The segment is locked and cannot be reallocated. ERROR_LOCKED

214	Too many dynamic-link modules are attached to this program or dynamic-link module. ERROR_TOO_MANY_MODULES

215	Can't nest calls to LoadModule. ERROR_NESTING_NOT_ALLOWED

216	The image file %1 is valid, but is for a machine type other than the current machine. ERROR_EXE_MACHINE_TYPE_MISMATCH

230	The pipe state is invalid. ERROR_BAD_PIPE

231	All pipe instances are busy. ERROR_PIPE_BUSY

232	The pipe is being closed. ERROR_NO_DATA

233	No process is on the other end of the pipe. ERROR_PIPE_NOT_CONNECTED

234	More data is available. ERROR_MORE_DATA

240	The session was canceled. ERROR_VC_DISCONNECTED

254	The specified extended attribute name was invalid. ERROR_INVALID_EA_NAME

255	The extended attributes are inconsistent. ERROR_EA_LIST_INCONSISTENT

259	No more data is available. ERROR_NO_MORE_ITEMS

266	The copy functions cannot be used. ERROR_CANNOT_COPY

267	The directory name is invalid. ERROR_DIRECTORY

275	The extended attributes did not fit in the buffer. ERROR_EAS_DIDNT_FIT

276	The extended attribute file on the mounted file system is corrupt. ERROR_EA_FILE_CORRUPT

277	The extended attribute table file is full. ERROR_EA_TABLE_FULL

278	The specified extended attribute handle is invalid. ERROR_INVALID_EA_HANDLE

282	The mounted file system does not support extended attributes. ERROR_EAS_NOT_SUPPORTED

288	Attempt to release mutex not owned by caller. ERROR_NOT_OWNER

298	Too many posts were made to a semaphore. ERROR_TOO_MANY_POSTS

299	Only part of a ReadProcessMemoty or WriteProcessMemory request was completed. ERROR_PARTIAL_COPY

300	The oplock request is denied. ERROR_OPLOCK_NOT_GRANTED

301	An invalid oplock acknowledgment was received by the system. ERROR_INVALID_OPLOCK_PROTOCOL

317	The system cannot find message text for message number 0x%1 in the message file for %2. ERROR_MR_MID_NOT_FOUND

487	Attempt to access invalid address. ERROR_INVALID_ADDRESS

534	Arithmetic result exceeded 32 bits. ERROR_ARITHMETIC_OVERFLOW

535	There is a process on other end of the pipe. ERROR_PIPE_CONNECTED

536	Waiting for a process to open the other end of the pipe. ERROR_PIPE_LISTENING

994	Access to the extended attribute was denied. ERROR_EA_ACCESS_DENIED

995	The I/O operation has been aborted because of either a thread exit or an application request. ERROR_OPERATION_ABORTED

996	Overlapped I/O event is not in a signaled state. ERROR_IO_INCOMPLETE

997	Overlapped I/O operation is in progress. ERROR_IO_PENDING

998	Invalid access to memory location. ERROR_NOACCESS

999	Error performing inpage operation. ERROR_SWAPERROR

1001	Recursion too deep; the stack overflowed. ERROR_STACK_OVERFLOW

1002	The window cannot act on the sent message. ERROR_INVALID_MESSAGE

1003	Cannot complete this function. ERROR_CAN_NOT_COMPLETE

1004	Invalid flags. ERROR_INVALID_FLAGS

1005	The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. ERROR_UNRECOGNIZED_VOLUME

1006	The volume for a file has been externally altered so that the opened file is no longer valid. ERROR_FILE_INVALID

1007	The requested operation cannot be performed in full-screen mode. ERROR_FULLSCREEN_MODE

1008	An attempt was made to reference a token that does not exist. ERROR_NO_TOKEN

1009	The configuration registry database is corrupt. ERROR_BADDB

1010	The configuration registry key is invalid. ERROR_BADKEY

1011	The configuration registry key could not be opened. ERROR_CANTOPEN

1012	The configuration registry key could not be read. ERROR_CANTREAD

1013	The configuration registry key could not be written. ERROR_CANTWRITE

1014	One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful. ERROR_REGISTRY_RECOVERED

1015	The registry is corrupted. The structure of one of the files that contains registry data is corrupted, or the system's image of the file in memory is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted. ERROR_REGISTRY_CORRUPT

1016	An I/O operation initiated by the registry failed unrecoverably. The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry. ERROR_REGISTRY_IO_FAILED

1017	The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format. ERROR_NOT_REGISTRY_FILE

1018	Illegal operation attempted on a registry key that has been marked for deletion. ERROR_KEY_DELETED

1019	System could not allocate the required space in a registry log. ERROR_NO_LOG_SPACE

1020	Cannot create a symbolic link in a registry key that already has subkeys or values. ERROR_KEY_HAS_CHILDREN

1021	Cannot create a stable subkey under a volatile parent key. ERROR_CHILD_MUST_BE_VOLATILE

1022	A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes. ERROR_NOTIFY_ENUM_DIR

1051	A stop control has been sent to a service that other running services are dependent on. ERROR_DEPENDENT_SERVICES_RUNNING

1052	The requested control is not valid for this service. ERROR_INVALID_SERVICE_CONTROL

1053	The service did not respond to the start or control request in a timely fashion. ERROR_SERVICE_REQUEST_TIMEOUT

1054	A thread could not be created for the service. ERROR_SERVICE_NO_THREAD

1055	The service database is locked. ERROR_SERVICE_DATABASE_LOCKED

1056	An instance of the service is already running. ERROR_SERVICE_ALREADY_RUNNING

1057	The account name is invalid or does not exist. ERROR_INVALID_SERVICE_ACCOUNT

1058	The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. ERROR_SERVICE_DISABLED

1059	Circular service dependency was specified. ERROR_CIRCULAR_DEPENDENCY

1060	The specified service does not exist as an installed service. ERROR_SERVICE_DOES_NOT_EXIST

1061	The service cannot accept control messages at this time. ERROR_SERVICE_CANNOT_ACCEPT_CTRL

1062	The service has not been started. ERROR_SERVICE_NOT_ACTIVE

1063	The service process could not connect to the service controller. ERROR_FAILED_SERVICE_CONTROLLER_CONNECT

1064	An exception occurred in the service when handling the control request. ERROR_EXCEPTION_IN_SERVICE

1065	The database specified does not exist. ERROR_DATABASE_DOES_NOT_EXIST

1066	The service has returned a service-specific error code. ERROR_SERVICE_SPECIFIC_ERROR

1067	The process terminated unexpectedly. ERROR_PROCESS_ABORTED

1068	The dependency service or group failed to start. ERROR_SERVICE_DEPENDENCY_FAIL

1069	The service did not start due to a logon failure. ERROR_SERVICE_LOGON_FAILED

1070	After starting, the service hung in a start-pending state. ERROR_SERVICE_START_HANG

1071	The specified service database lock is invalid. ERROR_INVALID_SERVICE_LOCK

1072	The specified service has been marked for deletion. ERROR_SERVICE_MARKED_FOR_DELETE

1073	The specified service already exists. ERROR_SERVICE_EXISTS

1074	The system is currently running with the last-known-good configuration. ERROR_ALREADY_RUNNING_LKG

1075	The dependency service does not exist or has been marked for deletion. ERROR_SERVICE_DEPENDENCY_DELETED

1076	The current boot has already been accepted for use as the last-known-good control set. ERROR_BOOT_ALREADY_ACCEPTED

1077	No attempts to start the service have been made since the last boot. ERROR_SERVICE_NEVER_STARTED

1078	The name is already in use as either a service name or a service display name. ERROR_DUPLICATE_SERVICE_NAME

1079	The account specified for this service is different from the account specified for other services running in the same process. ERROR_DIFFERENT_SERVICE_ACCOUNT

1080	Failure actions can only be set for Win32 services, not for drivers. ERROR_CANNOT_DETECT_DRIVER_FAILURE

1081	This service runs in the same process as the service control manager. Therefore, the service control manager cannot take action if this service's process terminates unexpectedly. ERROR_CANNOT_DETECT_PROCESS_ABORT

1082	No recovery program has been configured for this service. ERROR_NO_RECOVERY_PROGRAM

1100	The physical end of the tape has been reached. ERROR_END_OF_MEDIA

1101	A tape access reached a filemark. ERROR_FILEMARK_DETECTED

1102	The beginning of the tape or a partition was encountered. ERROR_BEGINNING_OF_MEDIA

1103	A tape access reached the end of a set of files. ERROR_SETMARK_DETECTED

1104	No more data is on the tape. ERROR_NO_DATA_DETECTED

1105	Tape could not be partitioned. ERROR_PARTITION_FAILURE

1106	When accessing a new tape of a multivolume partition, the current blocksize is incorrect. ERROR_INVALID_BLOCK_LENGTH

1107	Tape partition information could not be found when loading a tape. ERROR_DEVICE_NOT_PARTITIONED

1108	Unable to lock the media eject mechanism. ERROR_UNABLE_TO_LOCK_MEDIA

1109	Unable to unload the media. ERROR_UNABLE_TO_UNLOAD_MEDIA

1110	The media in the drive may have changed. ERROR_MEDIA_CHANGED

1111	The I/O bus was reset. ERROR_BUS_RESET

1112	No media in drive. ERROR_NO_MEDIA_IN_DRIVE

1113	No mapping for the Unicode character exists in the target multi-byte code page. ERROR_NO_UNICODE_TRANSLATION

1114	A dynamic link library (DLL) initialization routine failed. ERROR_DLL_INIT_FAILED

1115	A system shutdown is in progress. ERROR_SHUTDOWN_IN_PROGRESS

1116	Unable to abort the system shutdown because no shutdown was in progress. ERROR_NO_SHUTDOWN_IN_PROGRESS

1117	The request could not be performed because of an I/O device error. ERROR_IO_DEVICE

1118	No serial device was successfully initialized. The serial driver will unload. ERROR_SERIAL_NO_DEVICE

1119	Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened. ERROR_IRQ_BUSY

1120	A serial I/O operation was completed by another write to the serial port. The IOCTL_SERIAL_XOFF_COUNTER reached zero.) ERROR_MORE_WRITES

1121	A serial I/O operation completed because the timeout period expired. The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.) ERROR_COUNTER_TIMEOUT

1122	No ID address mark was found on the floppy disk. ERROR_FLOPPY_ID_MARK_NOT_FOUND

1123	Mismatch between the floppy disk sector ID field and the floppy disk controller track address. ERROR_FLOPPY_WRONG_CYLINDER

1124	The floppy disk controller reported an error that is not recognized by the floppy disk driver. ERROR_FLOPPY_UNKNOWN_ERROR

1125	The floppy disk controller returned inconsistent results in its registers. ERROR_FLOPPY_BAD_REGISTERS

1126	While accessing the hard disk, a recalibrate operation failed, even after retries. ERROR_DISK_RECALIBRATE_FAILED

1127	While accessing the hard disk, a disk operation failed even after retries. ERROR_DISK_OPERATION_FAILED

1128	While accessing the hard disk, a disk controller reset was needed, but even that failed. ERROR_DISK_RESET_FAILED

1129	Physical end of tape encountered. ERROR_EOM_OVERFLOW

1130	Not enough server storage is available to process this command. ERROR_NOT_ENOUGH_SERVER_MEMORY

1131	A potential deadlock condition has been detected. ERROR_POSSIBLE_DEADLOCK

1132	The base address or the file offset specified does not have the proper alignment. ERROR_MAPPED_ALIGNMENT

1140	An attempt to change the system power state was vetoed by another application or driver. ERROR_SET_POWER_STATE_VETOED

1141	The system BIOS failed an attempt to change the system power state. ERROR_SET_POWER_STATE_FAILED

1142	An attempt was made to create more links on a file than the file system supports. ERROR_TOO_MANY_LINKS

1150	The specified program requires a newer version of Windows. ERROR_OLD_WIN_VERSION

1151	The specified program is not a Windows or MS-DOS program. ERROR_APP_WRONG_OS

1152	Cannot start more than one instance of the specified program. ERROR_SINGLE_INSTANCE_APP

1153	The specified program was written for an earlier version of Windows. ERROR_RMODE_APP

1154	One of the library files needed to run this application is damaged. ERROR_INVALID_DLL

1155	No application is associated with the specified file for this operation. ERROR_NO_ASSOCIATION

1156	An error occurred in sending the command to the application. ERROR_DDE_FAIL

1157	One of the library files needed to run this application cannot be found. ERROR_DLL_NOT_FOUND

1158	The current process has used all of its system allowance of handles for Window Manager objects. ERROR_NO_MORE_USER_HANDLES

1159	The message can be used only with synchronous operations. ERROR_MESSAGE_SYNC_ONLY

1160	The indicated source element has no media. ERROR_SOURCE_ELEMENT_EMPTY

1161	The indicated destination element already contains media. ERROR_DESTINATION_ELEMENT_FULL

1162	The indicated element does not exist. ERROR_ILLEGAL_ELEMENT_ADDRESS

1163	The indicated element is part of a magazine that is not present. ERROR_MAGAZINE_NOT_PRESENT

1164	The indicated device requires reinitialization due to hardware errors. ERROR_DEVICE_REINITIALIZATION_NEEDED

1165	The device has indicated that cleaning is required before further operations are attempted. ERROR_DEVICE_REQUIRES_CLEANING

1166	The device has indicated that its door is open. ERROR_DEVICE_DOOR_OPEN

1167	The device is not connected. ERROR_DEVICE_NOT_CONNECTED

1168	Element not found. ERROR_NOT_FOUND

1169	There was no match for the specified key in the index. ERROR_NO_MATCH

1170	The property set specified does not exist on the object. ERROR_SET_NOT_FOUND

1171	The point passed to GetMouseMovePoints is not in the buffer. ERROR_POINT_NOT_FOUND

1172	The tracking (workstation) service is not running. ERROR_NO_TRACKING_SERVICE

1173	The Volume ID could not be found. ERROR_NO_VOLUME_ID

1200	The specified device name is invalid. ERROR_BAD_DEVICE

1201	The device is not currently connected but it is a remembered connection. ERROR_CONNECTION_UNAVAIL

1202	An attempt was made to remember a device that had previously been remembered. ERROR_DEVICE_ALREADY_REMEMBERED

1203	No network provider accepted the given network path. ERROR_NO_NET_OR_BAD_PATH

1204	The specified network provider name is invalid. ERROR_BAD_PROVIDER

1205	Unable to open the network connection profile. ERROR_CANNOT_OPEN_PROFILE

1206	The network connection profile is corrupted. ERROR_BAD_PROFILE

1207	Cannot enumerate a noncontainer. ERROR_NOT_CONTAINER

1208	An extended error has occurred. ERROR_EXTENDED_ERROR

1209	The format of the specified group name is invalid. ERROR_INVALID_GROUPNAME

1210	The format of the specified computer name is invalid. ERROR_INVALID_COMPUTERNAME

1211	The format of the specified event name is invalid. ERROR_INVALID_EVENTNAME

1212	The format of the specified domain name is invalid. ERROR_INVALID_DOMAINNAME

1213	The format of the specified service name is invalid. ERROR_INVALID_SERVICENAME

1214	The format of the specified network name is invalid. ERROR_INVALID_NETNAME

1215	The format of the specified share name is invalid. ERROR_INVALID_SHARENAME

1216	The format of the specified password is invalid. ERROR_INVALID_PASSWORDNAME

1217	The format of the specified message name is invalid. ERROR_INVALID_MESSAGENAME

1218	The format of the specified message destination is invalid. ERROR_INVALID_MESSAGEDEST

1219	The credentials supplied conflict with an existing set of credentials. ERROR_SESSION_CREDENTIAL_CONFLICT

1220	An attempt was made to establish a session to a network server, but there are already too many sessions established to that server. ERROR_REMOTE_SESSION_LIMIT_EXCEEDED

1221	The workgroup or domain name is already in use by another computer on the network. ERROR_DUP_DOMAINNAME

1222	The network is not present or not started. ERROR_NO_NETWORK

1223	The operation was canceled by the user. ERROR_CANCELLED

1224	The requested operation cannot be performed on a file with a user-mapped section open. ERROR_USER_MAPPED_FILE

1225	The remote system refused the network connection. ERROR_CONNECTION_REFUSED

1226	The network connection was gracefully closed. ERROR_GRACEFUL_DISCONNECT

1227	The network transport endpoint already has an address associated with it. ERROR_ADDRESS_ALREADY_ASSOCIATED

1228	An address has not yet been associated with the network endpoint. ERROR_ADDRESS_NOT_ASSOCIATED

1229	An operation was attempted on a nonexistent network connection. ERROR_CONNECTION_INVALID

1230	An invalid operation was attempted on an active network connection. ERROR_CONNECTION_ACTIVE

1231	The remote network is not reachable by the transport. ERROR_NETWORK_UNREACHABLE

1232	The remote system is not reachable by the transport. ERROR_HOST_UNREACHABLE

1233	The remote system does not support the transport protocol. ERROR_PROTOCOL_UNREACHABLE

1234	No service is operating at the destination network endpoint on the remote system. ERROR_PORT_UNREACHABLE

1235	The request was aborted. ERROR_REQUEST_ABORTED

1236	The network connection was aborted by the local system. ERROR_CONNECTION_ABORTED

1237	The operation could not be completed. A retry should be performed. ERROR_RETRY

1238	A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached. ERROR_CONNECTION_COUNT_LIMIT

1239	Attempting to log in during an unauthorized time of day for this account. ERROR_LOGIN_TIME_RESTRICTION

1240	The account is not authorized to log in from this station. ERROR_LOGIN_WKSTA_RESTRICTION

1241	The network address could not be used for the operation requested. ERROR_INCORRECT_ADDRESS

1242	The service is already registered. ERROR_ALREADY_REGISTERED

1243	The specified service does not exist. ERROR_SERVICE_NOT_FOUND

1244	The operation being requested was not performed because the user has not been authenticated. ERROR_NOT_AUTHENTICATED

1245	The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. ERROR_NOT_LOGGED_ON

1246	Continue with work in progress. ERROR_CONTINUE

1247	An attempt was made to perform an initialization operation when initialization has already been completed. ERROR_ALREADY_INITIALIZED

1248	No more local devices. ERROR_NO_MORE_DEVICES

1249	The specified site does not exist. ERROR_NO_SUCH_SITE

1250	A domain controller with the specified name already exists. ERROR_DOMAIN_CONTROLLER_EXISTS

1251	An error occurred while installing the Windows NT directory service. Please view the event log for more information. ERROR_DS_NOT_INSTALLED

1300	Not all privileges referenced are assigned to the caller. ERROR_NOT_ALL_ASSIGNED

1301	Some mapping between account names and security IDs was not done. ERROR_SOME_NOT_MAPPED

1302	No system quota limits are specifically set for this account. ERROR_NO_QUOTAS_FOR_ACCOUNT

1303	No encryption key is available. A well-known encryption key was returned. ERROR_LOCAL_USER_SESSION_KEY

1304	The Windows NT password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string. ERROR_NULL_LM_PASSWORD

1305	The revision level is unknown. ERROR_UNKNOWN_REVISION

1306	Indicates two revision levels are incompatible. ERROR_REVISION_MISMATCH

1307	This security ID may not be assigned as the owner of this object. ERROR_INVALID_OWNER

1308	This security ID may not be assigned as the primary group of an object. ERROR_INVALID_PRIMARY_GROUP

1309	An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client. ERROR_NO_IMPERSONATION_TOKEN

1310	The group may not be disabled. ERROR_CANT_DISABLE_MANDATORY

1311	There are currently no logon servers available to service the logon request. ERROR_NO_LOGON_SERVERS

1312	A specified logon session does not exist. It may already have been terminated. ERROR_NO_SUCH_LOGON_SESSION

1313	A specified privilege does not exist. ERROR_NO_SUCH_PRIVILEGE

1314	A required privilege is not held by the client. ERROR_PRIVILEGE_NOT_HELD

1315	The name provided is not a properly formed account name. ERROR_INVALID_ACCOUNT_NAME

1316	The specified user already exists. ERROR_USER_EXISTS

1317	The specified user does not exist. ERROR_NO_SUCH_USER

1318	The specified group already exists. ERROR_GROUP_EXISTS

1319	The specified group does not exist. ERROR_NO_SUCH_GROUP

1320	Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member. ERROR_MEMBER_IN_GROUP

1321	The specified user account is not a member of the specified group account. ERROR_MEMBER_NOT_IN_GROUP

1322	The last remaining administration account cannot be disabled or deleted. ERROR_LAST_ADMIN

1323	Unable to update the password. The value provided as the current password is incorrect. ERROR_WRONG_PASSWORD

1324	Unable to update the password. The value provided for the new password contains values that are not allowed in passwords. ERROR_ILL_FORMED_PASSWORD

1325	Unable to update the password because a password update rule has been violated. ERROR_PASSWORD_RESTRICTION

1326	Logon failure: unknown user name or bad password. ERROR_LOGON_FAILURE

1327	Logon failure: user account restriction. ERROR_ACCOUNT_RESTRICTION

1328	Logon failure: account logon time restriction violation. ERROR_INVALID_LOGON_HOURS

1329	Logon failure: user not allowed to log on to this computer. ERROR_INVALID_WORKSTATION

1330	Logon failure: the specified account password has expired. ERROR_PASSWORD_EXPIRED

1331	Logon failure: account currently disabled. ERROR_ACCOUNT_DISABLED

1332	No mapping between account names and security IDs was done. ERROR_NONE_MAPPED

1333	Too many local user identifiers (LUIDs) were requested at one time. ERROR_TOO_MANY_LUIDS_REQUESTED

1334	No more local user identifiers (LUIDs) are available. ERROR_LUIDS_EXHAUSTED

1335	The subauthority part of a security ID is invalid for this particular use. ERROR_INVALID_SUB_AUTHORITY

1336	The access control list (ACL) structure is invalid. ERROR_INVALID_ACL

1337	The security ID structure is invalid. ERROR_INVALID_SID

1338	The security descriptor structure is invalid. ERROR_INVALID_SECURITY_DESCR

1340	The inherited access control list (ACL) or access control entry (ACE) could not be built. ERROR_BAD_INHERITANCE_ACL

1341	The server is currently disabled. ERROR_SERVER_DISABLED

1342	The server is currently enabled. ERROR_SERVER_NOT_DISABLED

1343	The value provided was an invalid value for an identifier authority. ERROR_INVALID_ID_AUTHORITY

1344	No more memory is available for security information updates. ERROR_ALLOTTED_SPACE_EXCEEDED

1345	The specified attributes are invalid, or incompatible with the attributes for the group as a whole. ERROR_INVALID_GROUP_ATTRIBUTES

1346	Either a required impersonation level was not provided, or the provided impersonation level is invalid. ERROR_BAD_IMPERSONATION_LEVEL

1347	Cannot open an anonymous level security token. ERROR_CANT_OPEN_ANONYMOUS

1348	The validation information class requested was invalid. ERROR_BAD_VALIDATION_CLASS

1349	The type of the token is inappropriate for its attempted use. ERROR_BAD_TOKEN_TYPE

1350	Unable to perform a security operation on an object that has no associated security. ERROR_NO_SECURITY_ON_OBJECT

1351	Indicates a Windows NT Server could not be contacted or that objects within the domain are protected such that necessary information could not be retrieved. ERROR_CANT_ACCESS_DOMAIN_INFO

1352	The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation. ERROR_INVALID_SERVER_STATE

1353	The domain was in the wrong state to perform the security operation. ERROR_INVALID_DOMAIN_STATE

1354	This operation is only allowed for the Primary Domain Controller of the domain. ERROR_INVALID_DOMAIN_ROLE

1355	The specified domain did not exist. ERROR_NO_SUCH_DOMAIN

1356	The specified domain already exists. ERROR_DOMAIN_EXISTS

1357	An attempt was made to exceed the limit on the number of domains per server. ERROR_DOMAIN_LIMIT_EXCEEDED

1358	Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk. ERROR_INTERNAL_DB_CORRUPTION

1359	The security account database contains an internal inconsistency. ERROR_INTERNAL_ERROR

1360	Generic access types were contained in an access mask which should already be mapped to nongeneric types. ERROR_GENERIC_NOT_MAPPED

1361	A security descriptor is not in the right format (absolute or self-relative). ERROR_BAD_DESCRIPTOR_FORMAT

1362	The requested action is restricted for use by logon processes only. The calling process has not registered as a logon process. ERROR_NOT_LOGON_PROCESS

1363	Cannot start a new logon session with an ID that is already in use. ERROR_LOGON_SESSION_EXISTS

1364	A specified authentication package is unknown. ERROR_NO_SUCH_PACKAGE

1365	The logon session is not in a state that is consistent with the requested operation. ERROR_BAD_LOGON_SESSION_STATE

1366	The logon session ID is already in use. ERROR_LOGON_SESSION_COLLISION

1367	A logon request contained an invalid logon type value. ERROR_INVALID_LOGON_TYPE

1368	Unable to impersonate using a named pipe until data has been read from that pipe. ERROR_CANNOT_IMPERSONATE

1369	The transaction state of a registry subtree is incompatible with the requested operation. ERROR_RXACT_INVALID_STATE

1370	An internal security database corruption has been encountered. ERROR_RXACT_COMMIT_FAILURE

1371	Cannot perform this operation on built-in accounts. ERROR_SPECIAL_ACCOUNT

1372	Cannot perform this operation on this built-in special group. ERROR_SPECIAL_GROUP

1373	Cannot perform this operation on this built-in special user. ERROR_SPECIAL_USER

1374	The user cannot be removed from a group because the group is currently the user's primary group. ERROR_MEMBERS_PRIMARY_GROUP

1375	The token is already in use as a primary token. ERROR_TOKEN_ALREADY_IN_USE

1376	The specified local group does not exist. ERROR_NO_SUCH_ALIAS

1377	The specified account name is not a member of the local group. ERROR_MEMBER_NOT_IN_ALIAS

1378	The specified account name is already a member of the local group. ERROR_MEMBER_IN_ALIAS

1379	The specified local group already exists. ERROR_ALIAS_EXISTS

1380	Logon failure: the user has not been granted the requested logon type at this computer. ERROR_LOGON_NOT_GRANTED

1381	The maximum number of secrets that may be stored in a single system has been exceeded. ERROR_TOO_MANY_SECRETS

1382	The length of a secret exceeds the maximum length allowed. ERROR_SECRET_TOO_LONG

1383	The local security authority database contains an internal inconsistency. ERROR_INTERNAL_DB_ERROR

1384	During a logon attempt, the user's security context accumulated too many security IDs. ERROR_TOO_MANY_CONTEXT_IDS

1385	Logon failure: the user has not been granted the requested logon type at this computer. ERROR_LOGON_TYPE_NOT_GRANTED

1386	A cross-encrypted password is necessary to change a user password. ERROR_NT_CROSS_ENCRYPTION_REQUIRED

1387	A new member could not be added to a local group because the member does not exist. ERROR_NO_SUCH_MEMBER

1388	A new member could not be added to a local group because the member has the wrong account type. ERROR_INVALID_MEMBER

1389	Too many security IDs have been specified. ERROR_TOO_MANY_SIDS

1390	A cross-encrypted password is necessary to change this user password. ERROR_LM_CROSS_ENCRYPTION_REQUIRED

1391	Indicates an ACL contains no inheritable components. ERROR_NO_INHERITANCE

1392	The file or directory is corrupted and unreadable. ERROR_FILE_CORRUPT

1393	The disk structure is corrupted and unreadable. ERROR_DISK_CORRUPT

1394	There is no user session key for the specified logon session. ERROR_NO_USER_SESSION_KEY

1395	The service being accessed is licensed for a particular number of connections. No more connections can be made to the service at this time because there are already as many connections as the service can accept. ERROR_LICENSE_QUOTA_EXCEEDED

1400	Invalid window handle. ERROR_INVALID_WINDOW_HANDLE

1401	Invalid menu handle. ERROR_INVALID_MENU_HANDLE

1402	Invalid cursor handle. ERROR_INVALID_CURSOR_HANDLE

1403	Invalid accelerator table handle. ERROR_INVALID_ACCEL_HANDLE

1404	Invalid hook handle. ERROR_INVALID_HOOK_HANDLE

1405	Invalid handle to a multiple-window position structure. ERROR_INVALID_DWP_HANDLE

1406	Cannot create a top-level child window. ERROR_TLW_WITH_WSCHILD

1407	Cannot find window class. ERROR_CANNOT_FIND_WND_CLASS

1408	Invalid window; it belongs to other thread. ERROR_WINDOW_OF_OTHER_THREAD

1409	Hot key is already registered. ERROR_HOTKEY_ALREADY_REGISTERED

1410	Class already exists. ERROR_CLASS_ALREADY_EXISTS

1411	Class does not exist. ERROR_CLASS_DOES_NOT_EXIST

1412	Class still has open windows. ERROR_CLASS_HAS_WINDOWS

1413	Invalid index. ERROR_INVALID_INDEX

1414	Invalid icon handle. ERROR_INVALID_ICON_HANDLE

1415	Using private DIALOG window words. ERROR_PRIVATE_DIALOG_INDEX

1416	The list box identifier was not found. ERROR_LISTBOX_ID_NOT_FOUND

1417	No wildcards were found. ERROR_NO_WILDCARD_CHARACTERS

1418	Thread does not have a clipboard open. ERROR_CLIPBOARD_NOT_OPEN

1419	Hot key is not registered. ERROR_HOTKEY_NOT_REGISTERED

1420	The window is not a valid dialog window. ERROR_WINDOW_NOT_DIALOG

1421	Control ID not found. ERROR_CONTROL_ID_NOT_FOUND

1422	Invalid message for a combo box because it does not have an edit control. ERROR_INVALID_COMBOBOX_MESSAGE

1423	The window is not a combo box. ERROR_WINDOW_NOT_COMBOBOX

1424	Height must be less than 256. ERROR_INVALID_EDIT_HEIGHT

1425	Invalid device context (DC) handle. ERROR_DC_NOT_FOUND

1426	Invalid hook procedure type. ERROR_INVALID_HOOK_FILTER

1427	Invalid hook procedure. ERROR_INVALID_FILTER_PROC

1428	Cannot set nonlocal hook without a module handle. ERROR_HOOK_NEEDS_HMOD

1429	This hook procedure can only be set globally. ERROR_GLOBAL_ONLY_HOOK

1430	The journal hook procedure is already installed. ERROR_JOURNAL_HOOK_SET

1431	The hook procedure is not installed. ERROR_HOOK_NOT_INSTALLED

1432	Invalid message for single-selection list box. ERROR_INVALID_LB_MESSAGE

1433	LB_SETCOUNT sent to non-lazy list box. ERROR_SETCOUNT_ON_BAD_LB

1434	This list box does not support tab stops. ERROR_LB_WITHOUT_TABSTOPS

1435	Cannot destroy object created by another thread. ERROR_DESTROY_OBJECT_OF_OTHER_THREAD

1436	Child windows cannot have menus. ERROR_CHILD_WINDOW_MENU

1437	The window does not have a system menu. ERROR_NO_SYSTEM_MENU

1438	Invalid message box style. ERROR_INVALID_MSGBOX_STYLE

1439	Invalid system-wide (SPI_*) parameter. ERROR_INVALID_SPI_VALUE

1440	Screen already locked. ERROR_SCREEN_ALREADY_LOCKED

1441	All handles to windows in a multiple-window position structure must have the same parent. ERROR_HWNDS_HAVE_DIFF_PARENT

1442	The window is not a child window. ERROR_NOT_CHILD_WINDOW

1443	Invalid GW_* command. ERROR_INVALID_GW_COMMAND

1444	Invalid thread identifier. ERROR_INVALID_THREAD_ID

1445	Cannot process a message from a window that is not a multiple document interface (MDI) window. ERROR_NON_MDICHILD_WINDOW

1446	Popup menu already active. ERROR_POPUP_ALREADY_ACTIVE

1447	The window does not have scroll bars. ERROR_NO_SCROLLBARS

1448	Scroll bar range cannot be greater than 0x7FFF. ERROR_INVALID_SCROLLBAR_RANGE

1449	Cannot show or remove the window in the way specified. ERROR_INVALID_SHOWWIN_COMMAND

1450	Insufficient system resources exist to complete the requested service. ERROR_NO_SYSTEM_RESOURCES

1451	Insufficient system resources exist to complete the requested service. ERROR_NONPAGED_SYSTEM_RESOURCES

1452	Insufficient system resources exist to complete the requested service. ERROR_PAGED_SYSTEM_RESOURCES

1453	Insufficient quota to complete the requested service. ERROR_WORKING_SET_QUOTA

1454	Insufficient quota to complete the requested service. ERROR_PAGEFILE_QUOTA

1455	The paging file is too small for this operation to complete. ERROR_COMMITMENT_LIMIT

1456	A menu item was not found. ERROR_MENU_ITEM_NOT_FOUND

1457	Invalid keyboard layout handle. ERROR_INVALID_KEYBOARD_HANDLE

1458	Hook type not allowed. ERROR_HOOK_TYPE_NOT_ALLOWED

1459	This operation requires an interactive window station. ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION

1460	This operation returned because the timeout period expired. ERROR_TIMEOUT

1461	Invalid monitor handle. ERROR_INVALID_MONITOR_HANDLE

1500	The event log file is corrupted. ERROR_EVENTLOG_FILE_CORRUPT

1501	No event log file could be opened, so the event logging service did not start. ERROR_EVENTLOG_CANT_START

1502	The event log file is full. ERROR_LOG_FILE_FULL

1503	The event log file has changed between read operations. ERROR_EVENTLOG_FILE_CHANGED

1601	Failure accessing install service. ERROR_INSTALL_SERVICE

1602	The user canceled the installation. ERROR_INSTALL_USEREXIT

1603	Fatal error during installation. ERROR_INSTALL_FAILURE

1604	Installation suspended, incomplete. ERROR_INSTALL_SUSPEND

1605	Product code not registered. ERROR_UNKNOWN_PRODUCT

1606	Feature ID not registered. ERROR_UNKNOWN_FEATURE

1607	Component ID not registered. ERROR_UNKNOWN_COMPONENT

1608	Unknown property. ERROR_UNKNOWN_PROPERTY

1609	Handle is in an invalid state. ERROR_INVALID_HANDLE_STATE

1610	Configuration data corrupt. ERROR_BAD_CONFIGURATION

1611	Language not available. ERROR_INDEX_ABSENT

1612	Install source unavailable. ERROR_INSTALL_SOURCE_ABSENT

1613	Database version unsupported. ERROR_BAD_DATABASE_VERSION

1614	Product is uninstalled. ERROR_PRODUCT_UNINSTALLED

1615	SQL query syntax invalid or unsupported. ERROR_BAD_QUERY_SYNTAX

1616	Record field does not exist. ERROR_INVALID_FIELD

1700	The string binding is invalid. RPC_S_INVALID_STRING_BINDING

1701	The binding handle is not the correct type. RPC_S_WRONG_KIND_OF_BINDING

1702	The binding handle is invalid. RPC_S_INVALID_BINDING

1703	The RPC protocol sequence is not supported. RPC_S_PROTSEQ_NOT_SUPPORTED

1704	The RPC protocol sequence is invalid. RPC_S_INVALID_RPC_PROTSEQ

1705	The string universal unique identifier (UUID) is invalid. RPC_S_INVALID_STRING_UUID

1706	The endpoint format is invalid. RPC_S_INVALID_ENDPOINT_FORMAT

1707	The network address is invalid. RPC_S_INVALID_NET_ADDR

1708	No endpoint was found. RPC_S_NO_ENDPOINT_FOUND

1709	The timeout value is invalid. RPC_S_INVALID_TIMEOUT

1710	The object universal unique identifier (UUID) was not found. RPC_S_OBJECT_NOT_FOUND

1711	The object universal unique identifier (UUID) has already been registered. RPC_S_ALREADY_REGISTERED

1712	The type universal unique identifier (UUID) has already been registered. RPC_S_TYPE_ALREADY_REGISTERED

1713	The RPC server is already listening. RPC_S_ALREADY_LISTENING

1714	No protocol sequences have been registered. RPC_S_NO_PROTSEQS_REGISTERED

1715	The RPC server is not listening. RPC_S_NOT_LISTENING

1716	The manager type is unknown. RPC_S_UNKNOWN_MGR_TYPE

1717	The interface is unknown. RPC_S_UNKNOWN_IF

1718	There are no bindings. RPC_S_NO_BINDINGS

1719	There are no protocol sequences. RPC_S_NO_PROTSEQS

1720	The endpoint cannot be created. RPC_S_CANT_CREATE_ENDPOINT

1721	Not enough resources are available to complete this operation. RPC_S_OUT_OF_RESOURCES

1722	The RPC server is unavailable. RPC_S_SERVER_UNAVAILABLE

1723	The RPC server is too busy to complete this operation. RPC_S_SERVER_TOO_BUSY

1724	The network options are invalid. RPC_S_INVALID_NETWORK_OPTIONS

1725	There are no remote procedure calls active on this thread. RPC_S_NO_CALL_ACTIVE

1726	The remote procedure call failed. RPC_S_CALL_FAILED

1727	The remote procedure call failed and did not execute. RPC_S_CALL_FAILED_DNE

1728	A remote procedure call (RPC) protocol error occurred. RPC_S_PROTOCOL_ERROR

1730	The transfer syntax is not supported by the RPC server. RPC_S_UNSUPPORTED_TRANS_SYN

1732	The universal unique identifier (UUID) type is not supported. RPC_S_UNSUPPORTED_TYPE

1733	The tag is invalid. RPC_S_INVALID_TAG

1734	The array bounds are invalid. RPC_S_INVALID_BOUND

1735	The binding does not contain an entry name. RPC_S_NO_ENTRY_NAME

1736	The name syntax is invalid. RPC_S_INVALID_NAME_SYNTAX

1737	The name syntax is not supported. RPC_S_UNSUPPORTED_NAME_SYNTAX

1739	No network address is available to use to construct a universal unique identifier (UUID). RPC_S_UUID_NO_ADDRESS

1740	The endpoint is a duplicate. RPC_S_DUPLICATE_ENDPOINT

1741	The authentication type is unknown. RPC_S_UNKNOWN_AUTHN_TYPE

1742	The maximum number of calls is too small. RPC_S_MAX_CALLS_TOO_SMALL

1743	The string is too long. RPC_S_STRING_TOO_LONG

1744	The RPC protocol sequence was not found. RPC_S_PROTSEQ_NOT_FOUND

1745	The procedure number is out of range. RPC_S_PROCNUM_OUT_OF_RANGE

1746	The binding does not contain any authentication information. RPC_S_BINDING_HAS_NO_AUTH

1747	The authentication service is unknown. RPC_S_UNKNOWN_AUTHN_SERVICE

1748	The authentication level is unknown. RPC_S_UNKNOWN_AUTHN_LEVEL

1749	The security context is invalid. RPC_S_INVALID_AUTH_IDENTITY

1750	The authorization service is unknown. RPC_S_UNKNOWN_AUTHZ_SERVICE

1751	The entry is invalid. EPT_S_INVALID_ENTRY

1752	The server endpoint cannot perform the operation. EPT_S_CANT_PERFORM_OP

1753	There are no more endpoints available from the endpoint mapper. EPT_S_NOT_REGISTERED

1754	No interfaces have been exported. RPC_S_NOTHING_TO_EXPORT

1755	The entry name is incomplete. RPC_S_INCOMPLETE_NAME

1756	The version option is invalid. RPC_S_INVALID_VERS_OPTION

1757	There are no more members. RPC_S_NO_MORE_MEMBERS

1758	There is nothing to unexport. RPC_S_NOT_ALL_OBJS_UNEXPORTED

1759	The interface was not found. RPC_S_INTERFACE_NOT_FOUND

1760	The entry already exists. RPC_S_ENTRY_ALREADY_EXISTS

1761	The entry is not found. RPC_S_ENTRY_NOT_FOUND

1762	The name service is unavailable. RPC_S_NAME_SERVICE_UNAVAILABLE

1763	The network address family is invalid. RPC_S_INVALID_NAF_ID

1764	The requested operation is not supported. RPC_S_CANNOT_SUPPORT

1765	No security context is available to allow impersonation. RPC_S_NO_CONTEXT_AVAILABLE

1766	An internal error occurred in a remote procedure call (RPC). RPC_S_INTERNAL_ERROR

1767	The RPC server attempted an integer division by zero. RPC_S_ZERO_DIVIDE

1768	An addressing error occurred in the RPC server. RPC_S_ADDRESS_ERROR

1769	A floating-point operation at the RPC server caused a division by zero. RPC_S_FP_DIV_ZERO

1770	A floating-point underflow occurred at the RPC server. RPC_S_FP_UNDERFLOW

1771	A floating-point overflow occurred at the RPC server. RPC_S_FP_OVERFLOW

1772	The list of RPC servers available for the binding of auto handles has been exhausted. RPC_X_NO_MORE_ENTRIES

1773	Unable to open the character translation table file. RPC_X_SS_CHAR_TRANS_OPEN_FAIL

1774	The file containing the character translation table has fewer than bytes. RPC_X_SS_CHAR_TRANS_SHORT_FILE

1775	A null context handle was passed from the client to the host during a remote procedure call. RPC_X_SS_IN_NULL_CONTEXT

1777	The context handle changed during a remote procedure call. RPC_X_SS_CONTEXT_DAMAGED

1778	The binding handles passed to a remote procedure call do not match. RPC_X_SS_HANDLES_MISMATCH

1779	The stub is unable to get the remote procedure call handle. RPC_X_SS_CANNOT_GET_CALL_HANDLE

1780	A null reference pointer was passed to the stub. RPC_X_NULL_REF_POINTER

1781	The enumeration value is out of range. RPC_X_ENUM_VALUE_OUT_OF_RANGE

1782	The byte count is too small. RPC_X_BYTE_COUNT_TOO_SMALL

1783	The stub received bad data. RPC_X_BAD_STUB_DATA

1784	The supplied user buffer is not valid for the requested operation. ERROR_INVALID_USER_BUFFER

1785	The disk media is not recognized. It may not be formatted. ERROR_UNRECOGNIZED_MEDIA

1786	The workstation does not have a trust secret. ERROR_NO_TRUST_LSA_SECRET

1787	The SAM database on the Windows NT Server does not have a computer account for this workstation trust relationship. ERROR_NO_TRUST_SAM_ACCOUNT

1788	The trust relationship between the primary domain and the trusted domain failed. ERROR_TRUSTED_DOMAIN_FAILURE

1789	The trust relationship between this workstation and the primary domain failed. ERROR_TRUSTED_RELATIONSHIP_FAILURE

1790	The network logon failed. ERROR_TRUST_FAILURE

1791	A remote procedure call is already in progress for this thread. RPC_S_CALL_IN_PROGRESS

1792	An attempt was made to logon, but the network logon service was not started. ERROR_NETLOGON_NOT_STARTED

1793	The user's account has expired. ERROR_ACCOUNT_EXPIRED

1794	The redirector is in use and cannot be unloaded. ERROR_REDIRECTOR_HAS_OPEN_HANDLES

1795	The specified printer driver is already installed. ERROR_PRINTER_DRIVER_ALREADY_INSTALLED

1796	The specified port is unknown. ERROR_UNKNOWN_PORT

1797	The printer driver is unknown. ERROR_UNKNOWN_PRINTER_DRIVER

1798	The print processor is unknown. ERROR_UNKNOWN_PRINTPROCESSOR

1799	The specified separator file is invalid. ERROR_INVALID_SEPARATOR_FILE

1800	The specified priority is invalid. ERROR_INVALID_PRIORITY

1801	The printer name is invalid. ERROR_INVALID_PRINTER_NAME

1802	The printer already exists. ERROR_PRINTER_ALREADY_EXISTS

1803	The printer command is invalid. ERROR_INVALID_PRINTER_COMMAND

1804	The specified datatype is invalid. ERROR_INVALID_DATATYPE

1805	The environment specified is invalid. ERROR_INVALID_ENVIRONMENT

1806	There are no more bindings. RPC_S_NO_MORE_BINDINGS

1807	The account used is an interdomain trust account. Use your global user account or local user account to access this server. ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT

1808	The account used is a computer account. Use your global user account or local user account to access this server. ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT

1809	The account used is a server trust account. Use your global user account or local user account to access this server. ERROR_NOLOGON_SERVER_TRUST_ACCOUNT

1810	The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain. ERROR_DOMAIN_TRUST_INCONSISTENT

1811	The server is in use and cannot be unloaded. ERROR_SERVER_HAS_OPEN_HANDLES

1812	The specified image file did not contain a resource section. ERROR_RESOURCE_DATA_NOT_FOUND

1813	The specified resource type cannot be found in the image file. ERROR_RESOURCE_TYPE_NOT_FOUND

1814	The specified resource name cannot be found in the image file. ERROR_RESOURCE_NAME_NOT_FOUND

1815	The specified resource language ID cannot be found in the image file. ERROR_RESOURCE_LANG_NOT_FOUND

1816	Not enough quota is available to process this command. ERROR_NOT_ENOUGH_QUOTA

1817	No interfaces have been registered. RPC_S_NO_INTERFACES

1818	The remote procedure call was cancelled. RPC_S_CALL_CANCELLED

1819	The binding handle does not contain all required information. RPC_S_BINDING_INCOMPLETE

1820	A communications failure occurred during a remote procedure call. RPC_S_COMM_FAILURE

1821	The requested authentication level is not supported. RPC_S_UNSUPPORTED_AUTHN_LEVEL

1822	No principal name registered. RPC_S_NO_PRINC_NAME

1823	The error specified is not a valid Windows RPC error code. RPC_S_NOT_RPC_ERROR

1824	A UUID that is valid only on this computer has been allocated. RPC_S_UUID_LOCAL_ONLY

1825	A security package specific error occurred. RPC_S_SEC_PKG_ERROR

1826	Thread is not canceled. RPC_S_NOT_CANCELLED

1827	Invalid operation on the encoding/decoding handle. RPC_X_INVALID_ES_ACTION

1828	Incompatible version of the serializing package. RPC_X_WRONG_ES_VERSION

1829	Incompatible version of the RPC stub. RPC_X_WRONG_STUB_VERSION

1830	The RPC pipe object is invalid or corrupted. RPC_X_INVALID_PIPE_OBJECT

1831	An invalid operation was attempted on an RPC pipe object. RPC_X_WRONG_PIPE_ORDER

1832	Unsupported RPC pipe version. RPC_X_WRONG_PIPE_VERSION

1898	The group member was not found. RPC_S_GROUP_MEMBER_NOT_FOUND

1899	The endpoint mapper database entry could not be created. EPT_S_CANT_CREATE

1900	The object universal unique identifier (UUID) is the nil UUID. RPC_S_INVALID_OBJECT

1901	The specified time is invalid. ERROR_INVALID_TIME

1902	The specified form name is invalid. ERROR_INVALID_FORM_NAME

1903	The specified form size is invalid. ERROR_INVALID_FORM_SIZE

1904	The specified printer handle is already being waited on ERROR_ALREADY_WAITING

1905	The specified printer has been deleted. ERROR_PRINTER_DELETED

1906	The state of the printer is invalid. ERROR_INVALID_PRINTER_STATE

1907	The user must change his password before he logs on the first time. ERROR_PASSWORD_MUST_CHANGE

1908	Could not find the domain controller for this domain. ERROR_DOMAIN_CONTROLLER_NOT_FOUND

1909	The referenced account is currently locked out and may not be logged on to. ERROR_ACCOUNT_LOCKED_OUT

1910	The object exporter specified was not found. OR_INVALID_OXID

1911	The object specified was not found. OR_INVALID_OID

1912	The object resolver set specified was not found. OR_INVALID_SET

1913	Some data remains to be sent in the request buffer. RPC_S_SEND_INCOMPLETE

1914	Invalid asynchronous remote procedure call handle. RPC_S_INVALID_ASYNC_HANDLE

1915	Invalid asynchronous RPC call handle for this operation. RPC_S_INVALID_ASYNC_CALL

1916	The RPC pipe object has already been closed. RPC_X_PIPE_CLOSED

1917	The RPC call completed before all pipes were processed. RPC_X_PIPE_DISCIPLINE_ERROR

1918	No more data is available from the RPC pipe. RPC_X_PIPE_EMPTY

1919	No site name is available for this machine. ERROR_NO_SITENAME

1920	The file can not be accessed by the system. ERROR_CANT_ACCESS_FILE

1921	The name of the file cannot be resolved by the system. ERROR_CANT_RESOLVE_FILENAME

1922	The directory service evaluated group memberships locally. ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY

1923	The specified directory service attribute or value does not exist. ERROR_DS_NO_ATTRIBUTE_OR_VALUE

1924	The attribute syntax specified to the directory service is invalid. ERROR_DS_INVALID_ATTRIBUTE_SYNTAX

1925	The attribute type specified to the directory service is not defined. ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED

1926	The specified directory service attribute or value already exists. ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS

1927	The directory service is busy. ERROR_DS_BUSY

1928	The directory service is unavailable. ERROR_DS_UNAVAILABLE

1929	The directory service was unable to allocate a relative identifier. ERROR_DS_NO_RIDS_ALLOCATED

1930	The directory service has exhausted the pool of relative identifiers. ERROR_DS_NO_MORE_RIDS

1931	The requested operation could not be performed because the directory service is not the master for that type of operation. ERROR_DS_INCORRECT_ROLE_OWNER

1932	The directory service was unable to initialize the subsystem that allocates relative identifiers. ERROR_DS_RIDMGR_INIT_ERROR

1933	The requested operation did not satisfy one or more constraints associated with the class of the object. ERROR_DS_OBJ_CLASS_VIOLATION

1934	The directory service can perform the requested operation only on a leaf object. ERROR_DS_CANT_ON_NON_LEAF

1935	The directory service cannot perform the requested operation on the RDN attribute of an object. ERROR_DS_CANT_ON_RDN

1936	The directory service detected an attempt to modify the object class of an object. ERROR_DS_CANT_MOD_OBJ_CLASS

1937	The requested cross domain move operation could not be performed. ERROR_DS_CROSS_DOM_MOVE_ERROR

1938	Unable to contact the global catalog server. ERROR_DS_GC_NOT_AVAILABLE

2000	The pixel format is invalid. ERROR_INVALID_PIXEL_FORMAT

2001	The specified driver is invalid. ERROR_BAD_DRIVER

2002	The window style or class attribute is invalid for this operation. ERROR_INVALID_WINDOW_STYLE

2003	The requested metafile operation is not supported. ERROR_METAFILE_NOT_SUPPORTED

2004	The requested transformation operation is not supported. ERROR_TRANSFORM_NOT_SUPPORTED

2005	The requested clipping operation is not supported. ERROR_CLIPPING_NOT_SUPPORTED

2108	The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified. ERROR_CONNECTED_OTHER_PASSWORD

2202	The specified username is invalid. ERROR_BAD_USERNAME

2250	This network connection does not exist. ERROR_NOT_CONNECTED

2300	The specified color management module is invalid. ERROR_INVALID_CMM

2301	The specified color profile is invalid. ERROR_INVALID_PROFILE

2302	The specified tag was not found. ERROR_TAG_NOT_FOUND

2303	A required tag is not present. ERROR_TAG_NOT_PRESENT

2304	The specified tag is already present. ERROR_DUPLICATE_TAG

2305	The specified color profile is not associated with any device. ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE

2306	The specified color profile was not found. ERROR_PROFILE_NOT_FOUND

2307	The specified color space is invalid. ERROR_INVALID_COLORSPACE

2308	Image Color Management is not enabled. ERROR_ICM_NOT_ENABLED

2309	There was an error while deleting the color transform. ERROR_DELETING_ICM_XFORM

2310	The specified color transform is invalid. ERROR_INVALID_TRANSFORM

2401	This network connection has files open or requests pending. ERROR_OPEN_FILES

2402	Active connections still exist. ERROR_ACTIVE_CONNECTIONS

2404	The device is in use by an active process and cannot be disconnected. ERROR_DEVICE_IN_USE

3000	The specified print monitor is unknown. ERROR_UNKNOWN_PRINT_MONITOR

3001	The specified printer driver is currently in use. ERROR_PRINTER_DRIVER_IN_USE

3002	The spool file was not found. ERROR_SPOOL_FILE_NOT_FOUND

3003	A StartDocPrinter call was not issued. ERROR_SPL_NO_STARTDOC

3004	An AddJob call was not issued. ERROR_SPL_NO_ADDJOB

3005	The specified print processor has already been installed. ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED

3006	The specified print monitor has already been installed. ERROR_PRINT_MONITOR_ALREADY_INSTALLED

3007	The specified print monitor does not have the required functions. ERROR_INVALID_PRINT_MONITOR

3008	The specified print monitor is currently in use. ERROR_PRINT_MONITOR_IN_USE

3009	The requested operation is not allowed when there are jobs queued to the printer. ERROR_PRINTER_HAS_JOBS_QUEUED

3010	The requested operation is successful. Changes will not be effective until the system is rebooted. ERROR_SUCCESS_REBOOT_REQUIRED

3011	The requested operation is successful. Changes will not be effective until the service is restarted. ERROR_SUCCESS_RESTART_REQUIRED

4000	WINS encountered an error while processing the command. ERROR_WINS_INTERNAL

4001	The local WINS can not be deleted. ERROR_CAN_NOT_DEL_LOCAL_WINS

4002	The importation from the file failed. ERROR_STATIC_INIT

4003	The backup failed. Was a full backup done before? ERROR_INC_BACKUP

4004	The backup failed. Check the directory to which you are backing the database. ERROR_FULL_BACKUP

4005	The name does not exist in the WINS database. ERROR_REC_NON_EXISTENT

4006	Replication with a nonconfigured partner is not allowed. ERROR_RPL_NOT_ALLOWED

4100	The DHCP client has obtained an IP address that is already in use on the network. The local interface will be disabled until the DHCP client can obtain a new address. ERROR_DHCP_ADDRESS_CONFLICT

4200	The GUID passed was not recognized as valid by a WMI data provider. ERROR_WMI_GUID_NOT_FOUND

4201	The instance name passed was not recognized as valid by a WMI data provider. ERROR_WMI_INSTANCE_NOT_FOUND

4202	The data item ID passed was not recognized as valid by a WMI data provider. ERROR_WMI_ITEMID_NOT_FOUND

4203	The WMI request could not be completed and should be retried. ERROR_WMI_TRY_AGAIN

4204	The WMI data provider could not be located. ERROR_WMI_DP_NOT_FOUND

4205	The WMI data provider references an instance set that has not been registered. ERROR_WMI_UNRESOLVED_INSTANCE_REF

4206	The WMI data block or event notification has already been enabled. ERROR_WMI_ALREADY_ENABLED

4207	The WMI data block is no longer available. ERROR_WMI_GUID_DISCONNECTED

4208	The WMI data service is not available. ERROR_WMI_SERVER_UNAVAILABLE

4209	The WMI data provider failed to carry out the request. ERROR_WMI_DP_FAILED

4210	The WMI MOF information is not valid. ERROR_WMI_INVALID_MOF

4211	The WMI registration information is not valid. ERROR_WMI_INVALID_REGINFO

4300	The media identifier does not represent a valid medium. ERROR_INVALID_MEDIA

4301	The library identifier does not represent a valid library. ERROR_INVALID_LIBRARY

4302	The media pool identifier does not represent a valid media pool. ERROR_INVALID_MEDIA_POOL

4303	The drive and medium are not compatible or exist in different libraries. ERROR_DRIVE_MEDIA_MISMATCH

4304	The medium currently exists in an offline library and must be online to perform this operation. ERROR_MEDIA_OFFLINE

4305	The operation cannot be performed on an offline library. ERROR_LIBRARY_OFFLINE

4306	The library, drive, or media pool is empty. ERROR_EMPTY

4307	The library, drive, or media pool must be empty to perform this operation. ERROR_NOT_EMPTY

4308	No media is currently available in this media pool or library. ERROR_MEDIA_UNAVAILABLE

4309	A resource required for this operation is disabled. ERROR_RESOURCE_DISABLED

4310	The media identifier does not represent a valid cleaner. ERROR_INVALID_CLEANER

4311	The drive cannot be cleaned or does not support cleaning. ERROR_UNABLE_TO_CLEAN

4312	The object identifier does not represent a valid object. ERROR_OBJECT_NOT_FOUND

4313	Unable to read from or write to the database. ERROR_DATABASE_FAILURE

4314	The database is full. ERROR_DATABASE_FULL

4315	The medium is not compatible with the device or media pool. ERROR_MEDIA_INCOMPATIBLE

4316	The resource required for this operation does not exist. ERROR_RESOURCE_NOT_PRESENT

4317	The operation identifier is not valid. ERROR_INVALID_OPERATION

4318	The media is not mounted or ready for use. ERROR_MEDIA_NOT_AVAILABLE

4319	The device is not ready for use. ERROR_DEVICE_NOT_AVAILABLE

4320	The operator or administrator has refused the request. ERROR_REQUEST_REFUSED

4350	The remote storage service was not able to recall the file. ERROR_FILE_OFFLINE

4351	The remote storage service is not operational at this time. ERROR_REMOTE_STORAGE_NOT_ACTIVE

4352	The remote storage service encountered a media error. ERROR_REMOTE_STORAGE_MEDIA_ERROR

4390	The file or directory is not a reparse point. ERROR_NOT_A_REPARSE_POINT

4391	The reparse point attribute cannot be set because it conflicts with an existing attribute. ERROR_REPARSE_ATTRIBUTE_CONFLICT

5001	The cluster resource cannot be moved to another group because other resources are dependent on it. ERROR_DEPENDENT_RESOURCE_EXISTS

5002	The cluster resource dependency cannot be found. ERROR_DEPENDENCY_NOT_FOUND

5003	The cluster resource cannot be made dependent on the specified resource because it is already dependent. ERROR_DEPENDENCY_ALREADY_EXISTS

5004	The cluster resource is not online. ERROR_RESOURCE_NOT_ONLINE

5005	A cluster node is not available for this operation. ERROR_HOST_NODE_NOT_AVAILABLE

5006	The cluster resource is not available. ERROR_RESOURCE_NOT_AVAILABLE

5007	The cluster resource could not be found. ERROR_RESOURCE_NOT_FOUND

5008	The cluster is being shut down. ERROR_SHUTDOWN_CLUSTER

5009	A cluster node cannot be evicted from the cluster while it is online. ERROR_CANT_EVICT_ACTIVE_NODE

5010	The object already exists. ERROR_OBJECT_ALREADY_EXISTS

5011	The object is already in the list. ERROR_OBJECT_IN_LIST

5012	The cluster group is not available for any new requests. ERROR_GROUP_NOT_AVAILABLE

5013	The cluster group could not be found. ERROR_GROUP_NOT_FOUND

5014	The operation could not be completed because the cluster group is not online. ERROR_GROUP_NOT_ONLINE

5015	The cluster node is not the owner of the resource. ERROR_HOST_NODE_NOT_RESOURCE_OWNER

5016	The cluster node is not the owner of the group. ERROR_HOST_NODE_NOT_GROUP_OWNER

5017	The cluster resource could not be created in the specified resource monitor. ERROR_RESMON_CREATE_FAILED

5018	The cluster resource could not be brought online by the resource monitor. ERROR_RESMON_ONLINE_FAILED

5019	The operation could not be completed because the cluster resource is online. ERROR_RESOURCE_ONLINE

5020	The cluster resource could not be deleted or brought offline because it is the quorum resource. ERROR_QUORUM_RESOURCE

5021	The cluster could not make the specified resource a quorum resource because it is not capable of being a quorum resource. ERROR_NOT_QUORUM_CAPABLE

5022	The cluster software is shutting down. ERROR_CLUSTER_SHUTTING_DOWN

5023	The group or resource is not in the correct state to perform the requested operation. ERROR_INVALID_STATE

5024	The properties were stored but not all changes will take effect until the next time the resource is brought online. ERROR_RESOURCE_PROPERTIES_STORED

5025	The cluster could not make the specified resource a quorum resource because it does not belong to a shared storage class. ERROR_NOT_QUORUM_CLASS

5026	The cluster resource could not be deleted since it is a core resource. ERROR_CORE_RESOURCE

5027	The quorum resource failed to come online. ERROR_QUORUM_RESOURCE_ONLINE_FAILED

5028	The quorum log could not be created or mounted successfully. ERROR_QUORUMLOG_OPEN_FAILED

5029	The cluster log is corrupt. ERROR_CLUSTERLOG_CORRUPT

5030	The record could not be written to the cluster log since it exceeds the maximum size. ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE

5031	The cluster log exceeds its maximum size. ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE

5032	No checkpoint record was found in the cluster log. ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND

5033	The minimum required disk space needed for logging is not available. ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE

6000	The specified file could not be encrypted. ERROR_ENCRYPTION_FAILED

6001	The specified file could not be decrypted. ERROR_DECRYPTION_FAILED

6002	The specified file is encrypted and the user does not have the ability to decrypt it. ERROR_FILE_ENCRYPTED

6003	There is no encryption recovery policy configured for this system. ERROR_NO_RECOVERY_POLICY

6004	The required encryption driver is not loaded for this system. ERROR_NO_EFS

6005	The file was encrypted with a different encryption driver than is currently loaded. ERROR_WRONG_EFS

6006	There are no EFS keys defined for the user. ERROR_NO_USER_KEYS

6007	The specified file is not encrypted. ERROR_FILE_NOT_ENCRYPTED

6008	The specified file is not in the defined EFS export format. ERROR_NOT_EXPORT_FORMAT

6118	The list of servers for this workgroup is not currently available ERROR_NO_BROWSER_SERVERS_FOUND


Error-Codes (Win32-Net)

Win32 - Net Error Codes

2102	The workstation driver is not installed. NETERR_INCLUDED

2103	The server could not be located. NERR_UnknownServer

2104	An internal error occurred. The network cannot access a shared memory segment. NERR_ShareMem

2105	A network resource shortage occurred . NERR_NoNetworkResource

2106	This operation is not supported on workstations. NERR_RemoteOnly

2107	The device is not connected. NERR_DevNotRedirected

2114	The Server service is not started. NERR_ServerNotStarted

2115	The queue is empty. NERR_ItemNotFound

2116	The device or directory does not exist. NERR_UnknownDevDir

2117	The operation is invalid on a redirected resource. NERR_RedirectedPath

2118	The name has already been shared. NERR_DuplicateShare

2119	The server is currently out of the requested resource. NERR_NoRoom

2121	Requested addition of items exceeds the maximum allowed. NERR_TooManyItems

2122	The Peer service supports only two simultaneous users. NERR_InvalidMaxUsers

2123	The API return buffer is too small. NERR_BufTooSmall

2127	A remote API error occurred. NERR_RemoteErr

2131	An error occurred when opening or reading the configuration file. NERR_LanmanIniError

2136	A general network error occurred. NERR_NetworkError

2137	The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service. NERR_WkstaInconsistentState

2138	The Workstation service has not been started. NERR_WkstaNotStarted

2139	The requested information is not available. NERR_BrowserNotStarted

2140	An internal Windows NT error occurred.NERR_InternalError

2141	The server is not configured for transactions. NERR_BadTransactConfig

2142	The requested API is not supported on the remote server. NERR_InvalidAPI

2143	The event name is invalid. NERR_BadEventName

2144	The computer name already exists on the network. Change it and restart the computer. NERR_DupNameReboot

2146	The specified component could not be found in the configuration information. NERR_CfgCompNotFound

2147	The specified parameter could not be found in the configuration information. NERR_CfgParamNotFound

2149	A line in the configuration file is too long. NERR_LineTooLong

2150	The printer does not exist. NERR_QNotFound

2151	The print job does not exist. NERR_JobNotFound

2152	The printer destination cannot be found. NERR_DestNotFound

2153	The printer destination already exists. NERR_DestExists

2154	The printer queue already exists. NERR_QExists

2155	No more printers can be added. NERR_QNoRoom

2156	No more print jobs can be added. NERR_JobNoRoom

2157	No more printer destinations can be added. NERR_DestNoRoom

2158	This printer destination is idle and cannot accept control operations. NERR_DestIdle

2159	This printer destination request contains an invalid control function. NERR_DestInvalidOp

2160	The print processor is not responding. NERR_ProcNoRespond

2161	The spooler is not running. NERR_SpoolerNotLoaded

2162	This operation cannot be performed on the print destination in its current state. NERR_DestInvalidState

2163	This operation cannot be performed on the printer queue in its current state. NERR_QInvalidState

2164	This operation cannot be performed on the print job in its current state. NERR_JobInvalidState

2165	A spooler memory allocation failure occurred. NERR_SpoolNoMemory

2166	The device driver does not exist. NERR_DriverNotFound

2167	The data type is not supported by the print processor. NERR_DataTypeInvalid

2168	The print processor is not installed. NERR_ProcNotFound

2180	The service database is locked. NERR_ServiceTableLocked

2181	The service table is full. NERR_ServiceTableFull

2182	The requested service has already been started. NERR_ServiceInstalled

2183	The service does not respond to control actions. NERR_ServiceEntryLocked

2184	The service has not been started. NERR_ServiceNotInstalled

2185	The service name is invalid. NERR_BadServiceName

2186	The service is not responding to the control function. NERR_ServiceCtlTimeout

2187	The service control is busy. NERR_ServiceCtlBusy

2188	The configuration file contains an invalid service program name. NERR_BadServiceProgName

2189	The service could not be controlled in its present state. NERR_ServiceNotCtrl

2190	The service ended abnormally. NERR_ServiceKillProc

2191	The requested pause or stop is not valid for this service. NERR_ServiceCtlNotValid

2192	The service control dispatcher could not find the service name in the dispatch table. NERR_NotInDispatchTbl

2193	The service control dispatcher pipe read failed. NERR_BadControlRecv

2194	A thread for the new service could not be created. NERR_ServiceNotStarting

2200	This workstation is already logged on to the local-area network. NERR_AlreadyLoggedOn

2201	The workstation is not logged on to the local-area network. NERR_NotLoggedOn

2202	The user name or group name parameter is invalid. NERR_BadUsername

2203	The password parameter is invalid. NERR_BadPassword

2204	@W The logon processor did not add the message alias. NERR_UnableToAddName_W

2205	The logon processor did not add the message alias. NERR_UnableToAddName_F

2206	@W The logoff processor did not delete the message alias. NERR_UnableToDelName_W

2207	The logoff processor did not delete the message alias. NERR_UnableToDelName_F

2209	Network logons are paused. NERR_LogonsPaused

2210	A centralized logon-server conflict occurred. NERR_LogonServerConflict

2211	The server is configured without a valid user path. NERR_LogonNoUserPath

2212	An error occurred while loading or running the logon script. NERR_LogonScriptError

2214	The logon server was not specified. Your computer will be logged on as STANDALONE. NERR_StandaloneLogon

2215	The logon server could not be found. NERR_LogonServerNotFound

2216	There is already a logon domain for this computer. NERR_LogonDomainExists

2217	The logon server could not validate the logon. NERR_NonValidatedLogon

2219	The security database could not be found. NERR_ACFNotFound

2220	The group name could not be found. NERR_GroupNotFound

2221	The user name could not be found. NERR_UserNotFound

2222	The resource name could not be found. NERR_ResourceNotFound

2223	The group already exists. NERR_GroupExists

2224	The user account already exists. NERR_UserExists

2225	The resource permission list already exists. NERR_ResourceExists

2226	This operation is only allowed on the primary domain controller of the domain. NERR_NotPrimary

2227	The security database has not been started. NERR_ACFNotLoaded

2228	There are too many names in the user accounts database. NERR_ACFNoRoom

2229	A disk I/O failure occurred.NERR_ACFFileIOFail

2230	The limit of 64 entries per resource was exceeded. NERR_ACFTooManyLists

2231	Deleting a user with a session is not allowed. NERR_UserLogon

2232	The parent directory could not be located. NERR_ACFNoParent

2233	Unable to add to the security database session cache segment. NERR_CanNotGrowSegment

2234	This operation is not allowed on this special group. NERR_SpeGroupOp

2235	This user is not cached in user accounts database session cache. NERR_NotInCache

2236	The user already belongs to this group. NERR_UserInGroup

2237	The user does not belong to this group. NERR_UserNotInGroup

2238	This user account is undefined. NERR_AccountUndefined

2239	This user account has expired. NERR_AccountExpired

2240	The user is not allowed to log on from this workstation. NERR_InvalidWorkstation

2241	The user is not allowed to log on at this time. NERR_InvalidLogonHours

2242	The password of this user has expired. NERR_PasswordExpired

2243	The password of this user cannot change. NERR_PasswordCantChange

2244	This password cannot be used now. NERR_PasswordHistConflict

2245	The password is shorter than required. NERR_PasswordTooShort

2246	The password of this user is too recent to change. NERR_PasswordTooRecent

2247	The security database is corrupted. NERR_InvalidDatabase

2248	No updates are necessary to this replicant network/local security database. NERR_DatabaseUpToDate

2249	This replicant database is outdated; synchronization is required. NERR_SyncRequired

2250	The network connection could not be found. NERR_UseNotFound

2251	This asg_type is invalid. NERR_BadAsgType

2252	This device is currently being shared. NERR_DeviceIsShared

2270	The computer name could not be added as a message alias. The name may already exist on the network. NERR_NoComputerName

2271	The Messenger service is already started. NERR_MsgAlreadyStarted

2272	The Messenger service failed to start. NERR_MsgInitFailed

2273	The message alias could not be found on the network. NERR_NameNotFound

2274	This message alias has already been forwarded. NERR_AlreadyForwarded

2275	This message alias has been added but is still forwarded. NERR_AddForwarded

2276	This message alias already exists locally. NERR_AlreadyExists

2277	The maximum number of added message aliases has been exceeded. NERR_TooManyNames

2278	The computer name could not be deleted.NERR_DelComputerName

2279	Messages cannot be forwarded back to the same workstation. NERR_LocalForward

2280	An error occurred in the domain message processor. NERR_GrpMsgProcessor

2281	The message was sent, but the recipient has paused the Messenger service. NERR_PausedRemote

2282	The message was sent but not received. NERR_BadReceive

2283	The message alias is currently in use. Try again later. NERR_NameInUse

2284	The Messenger service has not been started. NERR_MsgNotStarted

2285	The name is not on the local computer. NERR_NotLocalName

2286	The forwarded message alias could not be found on the network. NERR_NoForwardName

2287	The message alias table on the remote station is full. NERR_RemoteFull

2288	Messages for this alias are not currently being forwarded. NERR_NameNotForwarded

2289	The broadcast message was truncated. NERR_TruncatedBroadcast

2294	This is an invalid device name. NERR_InvalidDevice

2295	A write fault occurred. NERR_WriteFault

2297	A duplicate message alias exists on the network. NERR_DuplicateName

2298	@W This message alias will be deleted later. NERR_DeleteLater

2299	The message alias was not successfully deleted from all networks. NERR_IncompleteDel

2300	This operation is not supported on computers with multiple networks. NERR_MultipleNets

2310	This shared resource does not exist.NERR_NetNameNotFound

2311	This device is not shared. NERR_DeviceNotShared

2312	A session does not exist with that computer name. NERR_ClientNameNotFound

2314	There is not an open file with that identification number. NERR_FileIdNotFound

2315	A failure occurred when executing a remote administration command. NERR_ExecFailure

2316	A failure occurred when opening a remote temporary file. NERR_TmpFile

2317	The data returned from a remote administration command has been truncated to 64K. NERR_TooMuchData

2318	This device cannot be shared as both a spooled and a non-spooled resource. NERR_DeviceShareConflict

2319	The information in the list of servers may be incorrect. NERR_BrowserTableIncomplete

2320	The computer is not active in this domain. NERR_NotLocalDomain

2321	The share must be removed from the Distributed File System before it can be deleted. NERR_IsDfsShare

2331	The operation is invalid for this device. NERR_DevInvalidOpCode

2332	This device cannot be shared. NERR_DevNotFound

2333	This device was not open. NERR_DevNotOpen

2334	This device name list is invalid. NERR_BadQueueDevString

2335	The queue priority is invalid. NERR_BadQueuePriority

2337	There are no shared communication devices. NERR_NoCommDevs

2338	The queue you specified does not exist. NERR_QueueNotFound

2340	This list of devices is invalid. NERR_BadDevString

2341	The requested device is invalid. NERR_BadDev

2342	This device is already in use by the spooler. NERR_InUseBySpooler

2343	This device is already in use as a communication device. NERR_CommDevInUse

2351	This computer name is invalid. NERR_InvalidComputer

2354	The string and prefix specified are too long. NERR_MaxLenExceeded

2356	This path component is invalid. NERR_BadComponent

2357	Could not determine the type of input. NERR_CantType

2362	The buffer for types is not big enough. NERR_TooManyEntries

2370	Profile files cannot exceed 64K. NERR_ProfileFileTooBig

2371	The start offset is out of range. NERR_ProfileOffset

2372	The system cannot delete current connections to network resources. NERR_ProfileCleanup

2373	The system was unable to parse the command line in this file.NERR_ProfileUnknownCmd

2374	An error occurred while loading the profile file. NERR_ProfileLoadErr

2375	@W Errors occurred while saving the profile file. The profile was partially saved. NERR_ProfileSaveErr

2377	Log file %1 is full. NERR_LogOverflow

2378	This log file has changed between reads. NERR_LogFileChanged

2379	Log file %1 is corrupt. NERR_LogFileCorrupt

2380	The source path cannot be a directory. NERR_SourceIsDir

2381	The source path is illegal. NERR_BadSource

2382	The destination path is illegal. NERR_BadDest

2383	The source and destination paths are on different servers. NERR_DifferentServers

2385	The Run server you requested is paused. NERR_RunSrvPaused

2389	An error occurred when communicating with a Run server. NERR_ErrCommRunSrv

2391	An error occurred when starting a background process. NERR_ErrorExecingGhost

2392	The shared resource you are connected to could not be found.NERR_ShareNotFound

2400	The LAN adapter number is invalid. NERR_InvalidLana

2401	There are open files on the connection. NERR_OpenFiles

2402	Active connections still exist. NERR_ActiveConns

2403	This share name or password is invalid. NERR_BadPasswordCore

2404	The device is being accessed by an active process. NERR_DevInUse

2405	The drive letter is in use locally. NERR_LocalDrive

2430	The specified client is already registered for the specified event. NERR_AlertExists

2431	The alert table is full. NERR_TooManyAlerts

2432	An invalid or nonexistent alert name was raised. NERR_NoSuchAlert

2433	The alert recipient is invalid.NERR_BadRecipient

2434	A user's session with this server has been deletedNERR_AcctLimitExceeded

2440	The log file does not contain the requested record number. NERR_InvalidLogSeek

2450	The user accounts database is not configured correctly. NERR_BadUasConfig

2451	This operation is not permitted when the Netlogon service is running. NERR_InvalidUASOp

2452	This operation is not allowed on the last administrative account. NERR_LastAdmin

2453	Could not find domain controller for this domain. NERR_DCNotFound

2454	Could not set logon information for this user. NERR_LogonTrackingError

2455	The Netlogon service has not been started. NERR_NetlogonNotStarted

2456	Unable to add to the user accounts database. NERR_CanNotGrowUASFile

2457	This server's clock is not synchronized with the primary domain controller's clock. NERR_TimeDiffAtDC

2458	A password mismatch has been detected. NERR_PasswordMismatch

2460	The server identification does not specify a valid server. NERR_NoSuchServer

2461	The session identification does not specify a valid session. NERR_NoSuchSession

2462	The connection identification does not specify a valid connection. NERR_NoSuchConnection

2463	There is no space for another entry in the table of available servers. NERR_TooManyServers

2464	The server has reached the maximum number of sessions it supports. NERR_TooManySessions

2465	The server has reached the maximum number of connections it supports. NERR_TooManyConnections

2466	The server cannot open more files because it has reached its maximum number. NERR_TooManyFiles

2467	There are no alternate servers registered on this server. NERR_NoAlternateServers

2470	Try down-level (remote admin protocol) version of API instead. NERR_TryDownLevel

2480	The UPS driver could not be accessed by the UPS service. NERR_UPSDriverNotStarted

2481	The UPS service is not configured correctly. NERR_UPSInvalidConfig

2482	The UPS service could not access the specified Comm Port. NERR_UPSInvalidCommPort

2483	The UPS indicated a line fail or low battery situation. Service not started. NERR_UPSSignalAsserted

2484	The UPS service failed to perform a system shut down. NERR_UPSShutdownFailed

2500	The program below returned an MS-DOS error code:NERR_BadDosRetCode

2501	The program below needs more memory:NERR_ProgNeedsExtraMem

2502	The program below called an unsupported MS-DOS function:NERR_BadDosFunction

2503	The workstation failed to boot.NERR_RemoteBootFailed

2504	The file below is corrupt.NERR_BadFileCheckSum

2505	No loader is specified in the boot-block definition file.NERR_NoRplBootSystem

2506	NetBIOS returned an error: The NCB and SMB are dumped above.NERR_RplLoadrNetBiosErr

2507	A disk I/O error occurred.NERR_RplLoadrDiskErr

2508	Image parameter substitution failed.NERR_ImageParamErr

2509	Too many image parameters cross disk sector boundaries.NERR_TooManyImageParams

2510	The image was not generated from an MS-DOS diskette formatted with /S.NERR_NonDosFloppyUsed

2511	Remote boot will be restarted later.NERR_RplBootRestart

2512	The call to the Remoteboot server failed.NERR_RplSrvrCallFailed

2513	Cannot connect to the Remoteboot server.NERR_CantConnectRplSrvr

2514	Cannot open image file on the Remoteboot server.NERR_CantOpenImageFile

2515	Connecting to the Remoteboot server...NERR_CallingRplSrvr

2516	Connecting to the Remoteboot server...NERR_StartingRplBoot

2517	Remote boot service was stopped; check the error log for the cause of the problem.NERR_RplBootServiceTerm

2518	Remote boot startup failed; check the error log for the cause of the problem.NERR_RplBootStartFailed

2519	A second connection to a Remoteboot resource is not allowed.NERR_RPL_CONNECTED

2550	The browser service was configured with MaintainServerList=No. NERR_BrowserConfiguredToNotRun

2610	Service failed to start since none of the network adapters started with this service.NERR_RplNoAdaptersStarted

2611	Service failed to start due to bad startup information in the registry.NERR_RplBadRegistry

2612	Service failed to start because its database is absent or corrupt.NERR_RplBadDatabase

2613	Service failed to start because RPLFILES share is absent.NERR_RplRplfilesShare

2614	Service failed to start because RPLUSER group is absent.NERR_RplNotRplServer

2615	Cannot enumerate service records.NERR_RplCannotEnum

2616	Workstation record information has been corrupted.NERR_RplWkstaInfoCorrupted

2617	Workstation record was not found.NERR_RplWkstaNotFound

2618	Workstation name is in use by some other workstation.NERR_RplWkstaNameUnavailable

2619	Profile record information has been corrupted.NERR_RplProfileInfoCorrupted

2620	Profile record was not found.NERR_RplProfileNotFound

2621	Profile name is in use by some other profile.NERR_RplProfileNameUnavailable

2622	There are workstations using this profile.NERR_RplProfileNotEmpty

2623	Configuration record information has been corrupted.NERR_RplConfigInfoCorrupted

2624	Configuration record was not found.NERR_RplConfigNotFound

2625	Adapter id record information has been corrupted.NERR_RplAdapterInfoCorrupted

2626	An internal service error has occurred.NERR_RplInternal

2627	Vendor id record information has been corrupted.NERR_RplVendorInfoCorrupted

2628	Boot block record information has been corrupted.NERR_RplBootInfoCorrupted

2629	The user account for this workstation record is missing.NERR_RplWkstaNeedsUserAcct

2630	The RPLUSER local group could not be found.NERR_RplNeedsRPLUSERAcct

2631	Boot block record was not found.NERR_RplBootNotFound

2632	Chosen profile is incompatible with this workstation.NERR_RplIncompatibleProfile

2633	Chosen network adapter id is in use by some other workstation.NERR_RplAdapterNameUnavailable

2634	There are profiles using this configuration.NERR_RplConfigNotEmpty

2635	There are workstations, profiles, or configurations using this boot block.NERR_RplBootInUse

2636	Service failed to backup Remoteboot database.NERR_RplBackupDatabase

2637	Adapter record was not found.NERR_RplAdapterNotFound

2638	Vendor record was not found.NERR_RplVendorNotFound

2639	Vendor name is in use by some other vendor record.NERR_RplVendorNameUnavailable

2640	(boot name, vendor id) is in use by some other boot block record.NERR_RplBootNameUnavailable

2641	Configuration name is in use by some other configuration.NERR_RplConfigNameUnavailable

2660	The internal database maintained by the Dfs service is corruptNERR_DfsInternalCorruption

2661	One of the records in the internal Dfs database is corruptNERR_DfsVolumeDataCorrupt

2662	There is no volume whose entry path matches the input Entry PathNERR_DfsNoSuchVolume

2663	A volume with the given name already existsNERR_DfsVolumeAlreadyExists

2664	The server share specified is already shared in the DfsNERR_DfsAlreadyShared

2665	The indicated server share does not support the indicated Dfs volumeNERR_DfsNoSuchShare

2666	The operation is not valid on a non-leaf volumeNERR_DfsNotALeafVolume

2667	The operation is not valid on a leaf volumeNERR_DfsLeafVolume

2668	The operation is ambiguous because the volume has multiple serversNERR_DfsVolumeHasMultipleServers

2669	Unable to create a junction pointNERR_DfsCantCreateJunctionPoint

2670	The server is not Dfs AwareNERR_DfsServerNotDfsAware

2671	The specified rename target path is invalidNERR_DfsBadRenamePath

2672	The specified Dfs volume is offlineNERR_DfsVolumeIsOffline

2673	The specified server is not a server for this volumeNERR_DfsNoSuchServer

2674	A cycle in the Dfs name was detectedNERR_DfsCyclicalName

2675	The operation is not supported on a server-based DfsNERR_DfsNotSupportedInServerDfs

2690	Dfs internal errorNERR_DfsInternalError

2691	This machine is already joined to a domain.NERR_SetupAlreadyJoined

2692	This machine is not currently joined to a domain. NERR_SetupNotJoined

2693	This machine is a domain controller and cannot be unjoined from a domain. NERR_SetupDomainController


Files and directories

Directory-Layout:

   (root)

     |

     |

     +-- Server

     |     |

     |     +-- (servernames)

     |

     +-- Groups

     |     |

     |     +-- News.Out

     |     |

     |     +-- (groupnames)

     |

     +-- Mails

     |     |

     |     +-- Mail.Out

     |     |

     |     +-- admin

     |     |

     |     +-- (accounts)

     |

     +-- Logs

Files in "(root)":

Hamster.exe

The incredible Hamster-machine.

Hamster.hlp

Hamster's helpfile.

Hamster.ini

Hamster-settings.

Options which can only be set manually:

[Directories]

; Set the root directory, where Hamster's files are located. If

; this setting is empty (default), Hamster uses the directory,

; where Hamster.exe was started from.

; NOTE: This "Main"-setting is always read from file Hamster.ini

;       in the same directory, where Hamster.exe was started from.

;       All additional settings are then read from Hamster.ini in

;       the given "Main"-directory.

Main=

; e.g.: Main=D:\Data\Hamster

; Set the location of additional directories used by Hamster.

; These settings are treated as subdirectories within the "Main"-

       ; directory, unless a root-path is given.

Server=Server

Groups=Groups

Mails=Mails

Logs=Logs

Scripts=

; e.g.: Logs=E:\Logfiles\Hamster

[Setup]

; Disable Hamster's "X-Posting-Agent:"-header for news/mails:

news.addxhamster=0

mail.addxhamster=0

; Disable Hamster's "Received:"-header for mails:

mail.addreceived=0

; Timeout in minutes after which the local-servers disconnect

; inactive clients (default 60):

local.timeout.inactivity=60

; Time in milliseconds for which Hamster waits before closing

; a connection after QUIT-command (default 100 ms):

local.timeout.quitdelay=100

; Period in seconds, for which a POP3-authentication remains

; valid for SMTP-after-POP3 (default 300 s)

local.smtpafterpop3.period=300

; Defines one or more SASL mechanisms, which may be used to

; authenticate a client on the local SMTP server (default and

; the only SASL mechanism supported so far is: LOGIN)

local.smtp.sasl=LOGIN

; Limits for line-length and text-size sent to one of Hamster's

; local servers. If one of the limits is exceeded, the connection

; will be terminated (default: 1000/2MB; 0 to disable):

local.limit.linelen.nntp=1000

local.limit.linelen.pop3=1000

local.limit.linelen.smtp=1000

local.limit.textsize.nntp=2097152

local.limit.textsize.pop3=2097152

local.limit.textsize.smtp=2097152

; Seconds after which remote-servers have to answer (when

; connecting/after sending a command) before a 'no response

; from server' is assumed (in seconds; default: 120).

remote.timeout.connect=120

remote.timeout.command=120

; Remove Message-ID from mails sent to local SMTP-server,

; if its FQDN is one of those in this comma-separated list:

mail.removemids=fqdn1,fqdn2,fqdn3,...

; Defines how the keyword is built for encoding the entries in

; password-file. If set to 1, the user-name is not used for it

; (e.g. on NT, if Hamster is used with different logins). If set

; to 2, neither computer nor OS-specific values are used.

; Note: You have to restart Hamster and set all passwords again

;       after changing this value!

password.codebase=0

; If sending of a mail fails for any reason, Hamster tries it

; again later for a given number of times (.max=...). Finally,

; the undeliverable mail-file is either renamed to "*.err"

; (.del=0) or deleted (.del=1) to avoid further attempts.

sendmail.attempts.max=10

sendmail.attempts.del=0

; Global filters for fetched mails based on the size of the

; messages (reported by initial LIST-command). If a message

; exceeds the given size, it is ignored (.ignore), killed

; (.kill) or a notification-message is sent to admin (.notify).

; A value of 0 (default) disables these filters, which have a

; higher priority than the mailfilters defined in MailFilt.hst.

mail.filter.mailsize.ignore=0

mail.filter.mailsize.kill=0

mail.filter.mailsize.notify=0

; Number of lines of mailbody to load when retrieving headers for

; mailfilters. These lines are included in notification-messages

; when ignoring or killing mails.

mail.filter.toplines=20

; Number of days to keep entries in mail-history (default: 14).

purge.mhistory.keepdays=14

; The history-file is splitted in multiple files and this setting

; controls, how many files are used ("0"=1 file, "2"=4 files, ...,

; "8"=256 files). The default-setting of "4" results in 2^4=16 files,

; which should be OK for most cases.

; To change the number of files used (which is NOT recommended for

; installations with less than 100.000-200.000 articles):

;    1. close Hamster

;    2. change "history-chunkbits"-setting

;    3. delete "hist*.dat" in "groups"-directory

;    4. start Hamster to (automatically) rebuild the history file

history.chunkbits=4

; Defines the editor to use for editing scripts. "editor.app" gives

; the program to start and "editor.params" gives its command-line

; parameters, where "%1" is replaced by the filename to edit.

; Default editor-setting is "notetab.exe" with parameters "%1":

editor.app=notepad.exe

editor.params=%1

; Defines the names of Hamster-internal groups:

;    .default     : used for all functions if no other name is given

;    .postok      : report articles which were posted successfully

;    .posterrors  : report articles which failed on posting

;    .statistics  : daily group-statistics

;    .cancelnotify: notifications for cancels in local groups

;    .newgroups   : report new newsgroups

;    .unknowngroup: container for articles with unknown groups

;    .pullerrors  : report pull-errors (e.g. outdated groups)

; Default is to save all articles in "internal.misc":

internalgroup.default=internal.misc

internalgroup.postok=

internalgroup.posterrors=

internalgroup.statistics=

internalgroup.cancelnotify=

internalgroup.newgroups=

internalgroup.unknowngroup=

internalgroup.pullerrors=

; Defines the name of a X-header, which is added to posted articles.

; The content of such a trace-header consists of the following values:

; FQDN/localhost, time, thread-id, client's IP, user-id, thread-id

; (hex), date-str., time-str.

; If posted article already contains such a header, article will not

; be rejected, but existing header will be renamed to 'X-Old-...'.

; Default is empty, i.e. don't add such a trace-header.

news.addxhtrace=

; e.g.: news.addxhtrace=X-Hamster-Trace

; -> X-Hamster-Trace: x.y.z 963151230 236 127.0.0.1 (1 ec 2000.07.09 14:00:30)

[Main]

; Set the status information for the bottom line of the main window

; (BottomlineFormat=...) and for the hint text of the icon in system

; tray (HintFormat=...).

; Placeholders:

;   %TA   Active tasks

;   %JO   Remaining jobs

;   %NO   News to post (News.Out)

;   %MO   Mails to send (Mail.Out)

;   %NI   New News (News In, %NI=%NL+%NH+%NK)

;   %NL   News loaded

;   %NH   News ignored due to history

;   %NK   News killed

;   %MI   Mails loaded

;   %BY   Bytes transfered

;   %KB   KByte transfered

BottomlineFormat=Jobs=%TA/%JO   OutBox: N/M=%NO/%MO   News=%NI (Load=%NL History=%NH Kill=%NK)   Mails=%MI   Byte=%BY

HintFormat=Tasks/Jobs=%TA/%JO  N/M=%NO/%MO  Arts=%NI  Mails=%MI

Changes.txt

Version-history.

Groups.hst

List of Hamster-newsgroups.

Pulls.hst

List of newsgroups to pull from newsservers.

Server.hst, SrvPOP3.hst, SrvSMTP.hst

List of NNTP-/POP3- and SMTP-Servers.

Password.!!!

Password-settings.

Accounts.!!!

Local accounts and their settings.

IPAccess.hst

Allow/refuse connections based on client-addresses.

Scores.hst

Scorefile used when pulling news.

MailFilt.hst

Filters used when fetching mails.

Ham.exe

Commandline-utility to view and export news-articles (see "ham help" for details).

h*.hsc, demo*.hsc

Hamster-Scripts

h*.pl, demo*.pl

Perl-Scripts

h*.vbs, demo*.vbs

VBScript-Scripts ("Windows Script Host")

Files in "(root)\Server":

allpulls.txt

Old file - not used any more.

alldescs.txt

Contains a list of all available groups with their descriptions.

Format: group-name TAB group-description

Files in "(root)\Server\(servernames)":

Greeting.txt

Initial greeting-message of server.

Groups.txt

Grouplist of server.

Help.txt

Helpfile of server.

NewGrps.txt

List of new groups on server ("Groups.txt" will be updated also).

GrpDescs.txt

List of group-descriptions loaded from server.

Overview.txt

Supported overview-fields of server.

Server.ini

Server-specific settings.

Options which can only be set manually:

[Setup]

; If ReadOnly is set to 1, the given newsserver will not bei used

; to post articles (default: 0).

ReadOnly=0

[Newgroups]

; If 4-Digit-Years is set to 1, NEWGROUPS-command is invoked with

; format "YYYYMMDD ..." (default: 0 = 2-digits).

4-Digit-Years=0

; Normally, "LastGMT" contains a timestamp for when new groups were

; retrieved the last time. To disable retrieval of new groups, you

; can set it to "NEVER".

LastGMT=NEVER

[Pull]

; Number of threads started when pulling news (range: 0-4, default: 1).

; NOTE: The usage-policy for some servers might order you not to use

; higher values than 1, 2 or 3. If in doubt, ask your newsmaster, how

; many concurrent connections ("sockets") are allowed on his server.

Threads=1

[SMTP]

; If set to 1, Hamster uses SMTP AUTH to login to this SMTP server

; (default is 0, i.e. don't authenticate).

AUTH=0

; Defines a list of SASL mechanisms (separated by space), which may

; be used to authenticate on this SMTP server (default is empty, which

; means, that all mechanisms supported by Hamster may be used; the only

; SASL mechanism supported so far is: LOGIN)

SASL=

[POP3]

; If set to 1, Hamster does not delete mails loaded from this server,

; even if global "Leave mails on server" (Configuration/Settings) is

; not set (default: 0, i.e. global setting applies).

LeaveOnServer=0

GetMids.txt

List of Message-IDs to pull from server (used for loading articles at "Killfile-Log -> Mark article for retrieval"). If a Message-ID is preceded with "!", it will be pulled from server, even if it's already marked as "known" in the history-file.

Files in "(root)\Groups":

History.dat

Old file - not used any more.

Hist4??.dat

A list of article-infos (primarily a MD5-hash of Message-ID) used to recognize already loaded articles and to find again articles by Message-ID later.

Kills.log

Overview-lines of articles not loaded due to scorefile-settings.

Files in "(root)\Groups\News.Out":

*.msg

Messages posted to the local NNTP-server (each article in a separate textfile). They will be deleted after posting it on a newsserver.

If configured so, Hamster will add a Message-ID before posting the article, if - and only if - the article does not have one already. Hamster itself does not overwrite existing Message-IDs.

BETA-note: Hamster will add a "X-Posting-Agent: Hamster Vr. ..."-versionheader on each article before posting.

Files in "(root)\Groups\(groupnames)":

data.dat

Article-data.

data.idx

Index of articles stored in "data.dat".

data.ini

Group-specific infos and settings.

Files in "(root)\Mails":

MHistory.dat

Similar to the history-files in the groups-directory, this file is used to recognize already loaded mails.

Files in "(root)\Mails\Mail.Out":

*.msg

Mails sent to the local SMTP-server (each mail in a separate textfile; leading SMTP-envelope-lines are marked with an exclamation-mark "!"). The mails will be deleted after they have been sent out to an external SMTP-server.

Files in "(root)\Mails\admin":

*.msg

Mails loaded from external POP3-servers (each mail in a separate textfile).

Files in "(root)\Logs":

0.log, 1.log, 2.log, ...

Hamster session-logfiles. Each time Hamster is started, the files are shifted up by 1 (0.log->1.log, 1.log->2.log, ...). "0.log" is always the most current logfiles.

MailIn.log

Contains infos for each mail, fetched from external POP3-servers.

MailOut.log

Contains infos for each mail, sent to external SMTP-servers.

RasDial.log

Contains an entry for each dial-up connection initiated by Hamster.


IPAccess.hst
File: (root)\IPAccess.hst

Purpose:

Allow or refuse connections to local servers based on the IP-address of connecting clients.

Format:

Plain-text.

Comments starting with "#" or ";" may be added to enhance readability.

Each definition-line consists of 3 to 4 values separated by commas (","):

1.) Scope

This value describes, which local servers are affected by the setting. For example, a line starting with "NNTP" only affects the local NNTP-Server, but not the POP3-/SMTP-servers.

Keywords:

NNTP:	Local NNTP-server

POP3:	Local POP3-server

SMTP:	Local SMTP-server

MAIL:	Local POP3- and SMTP-server

ALL:	All local servers

2.) Access

This value describes, if a client can connect to the given local server(s) and which actions are allowed on it.

Keywords:

RW:	Allow Read/Write

WO:	Allow Write-Only

RO:	Allow Read-Only

NA:	No Access

The distinction between read- and write-access is only a logical issue. The behaviour is as follows:

Scope	Access	Effect

NNTP	RW/RO	Client can read articles.

NNTP	RW	Client can read and post articles.

POP3	RW/RO	Client can fetch mails.

SMTP	RW/WO	Client can send mails.

(all)	(other)	Connection is refused.

3.) Range of IP-addresses (low address)

4.) Range of IP-addresses (high address)

Upper bound may be ommitted if it's only a setting for a single address.

Special setting for local IP-addresses:

The special keyword "LOCAL" in field 3 tells Hamster, that all IP-addresses of the local computer should be treated like the address given in the 4th parameter. This setting is especially useful, if local addresses are assigned dynamically, e.g. address assigned by a DHCP-server or assigned by your provider on dial-up.

Fields 1 and 2 have no meaning in this case, but they have to be syntactically correct.

Example:

# all local IP-addresses should be treated as 127.0.0.1:

ALL, NA, LOCAL, 127.0.0.1

Implementation notes:

(*) The definition-list is only loaded once when starting Hamster, so you have to restart Hamster after editing the file.

(*) As Hamster is intended to be used "at home", the default-setting is to allow full access on all local servers for adresses 127.0.0.1 and 192.168.0.0-192.168.255.255. Furthermore, all local IP-addresses are treated like "127.0.0.1".

To change this behaviour, you have to create a file named "IPAccess.hst" in Hamster's root-directory and add at least one valid definition-line.

(*) The definition-list is tested from top to down and the first matching definition-line is used. If no definition-line matches, connection is refused.

Example:

# treat all local IP-addresses like 127.0.0.1:

ALL, NA, LOCAL, 127.0.0.1

# full access on all services for localhost:

ALL, RW, 127.0.0.1

# full access on all services for LAN-stations:

ALL, RW, 192.168.0.0, 192.168.255.255

# full access on all services for specific addresses:

ALL, RW, 11.22.33.44  # John Doe

ALL, RW, 44.33.22.11  # Jane Doe

# readonly-access on news for all other addresses:

NNTP, RO, 0.0.0.0, 255.255.255.255

# no access for all other addresses and services:

ALL, NA, 0.0.0.0, 255.255.255.255


Scores.hst
File: (root)\Scores.hst

Purpose:

The rules in file "Scores.hst" determine, which articles will be loaded immediately, which will be logged in the Killfile-Log and which will be ignored completely when pulling new news.

This filtering is done with a technique called "Scoring". In Hamster, this means, that each article starts with a score-value of zero and then gains or loses points if it matches one or more of the given score-rules.

The final score-value then determines, if the article will be loaded. If the value is greater than or equal to zero (>=0), it will be loaded immediately. Otherwise (<0) it will not be loaded but saved in the Killfile-Log, from where it later can be loaded manually. To keep this logfile small and clear, you can further set a score-limit under Killfile-Settings, which prevents log-entries for articles with a "very low" score-value.

Syntax-Overview:

ScoreFile       = *( ScoreBlock / cEOL )

ScoreBlock      = ScoreScope *( ScoreRule / cEOL )

ScoreScope      = "[" ScopePattern *( 1*WSP ScopePattern ) "]" cEOL

ScopePattern    = [ "+" / "-" ] Pattern

ScoreRule       = ["="] ScoreValue 1*WSP ScoreSelection cEOL

ScoreValue      = ( "+" / "-" ) <Number>

ScoreSelection  = ScoreDefField 1*( 1*WHSP ScorePattern )

ScorePattern    = ["+"/"-"] [ "@" ScoreField ":" ] Pattern

ScoreDefField   = [ "~" ] ScoreField

ScoreField      = ( "Number" / "Subject" / "From" / "Date" /

                    "Message-ID" / "References" / "Bytes" /

                    "Lines" / "Xref" / "Xpost" / "Age" ) [":"]

Pattern         = ( PatRegExp / PatSimple )

PatRegExp       = "{" <PCRE-style regex-pattern> "}"

PatSimple       = ( PatSimpleAll / PatSimpleText / PatSimpleNumber )

PatSimpleAll    = "*"

PatSimpleText   = """ <Text> """

PatSimpleNumber = "%" ( "<" / "=" / ">" ) <Number>

cEOL            = [ "#" <Comment> ] CRLF

Score-Scope:

Each section starts with a "[...]"-header describing the groupnames, for which the following score-lines should be tested:

[*]

# score-lines for all groups

[* -".announce"]

# score-lines for all groups except those containing ".announce"

["news" "usenet"]

# score-lines for all groups containing "news" or "usenet".

[{^news\.} {^alt\.usenet\.}]

# score-lines for all groups starting with "news." or "alt.usenet."

The patterns within "[...]" follow the same rules as the "Score-Patterns" described below.

Score-Rules:

The score-value for a tested article is raised with "+"- and lowered with "-"-values:

+100 subject "hamster"

-100 subject "make money fast"

If a matching score-line is preceded with "=", the score-value is set to the given value and no further tests will be made for this article:

=+9999 from "my.mail@address"

=-9999 from "spam.mail@address"

The scoreable fields depend on the overview-information returned by the newsserver ("XOVER")[*]. In most cases, the following fields are available for scoring: Subject, From, Date, Age, Message-ID, References, Bytes, Lines, Xref, Xpost:

+100 subject "hamster"

-100 from {no.*spam}

+500 message-id "my.unique.fqdn"

+100 references "my.unique.fqdn"

-100 bytes %>10000

-100 lines %>250

[*] Note: Hamster does not support additional fields returned by the server yet.

The fictitious header-field Xpost is based on Xref and gives the number of groups, the article was crossposted to:

-10 xpost %>2     # posted to more than 2 groups

=-9999 xpost %>5  # posted to more than 5 groups

The fictitious header-field Age is based on Date and gives the age of the article in days:

=-9999 age %>14   # ignore all articles older than 14 days

If a fieldname is preceded with "~", the value of the given field is MIME-decoded before testing:

+100 ~subject "hämstêr"

-100 ~from "jürgen"

Score-Patterns:

Patterns without a leading "+"- or "-"-sign mean, that one or more of them must match:

# "hamster" or "newsserver" or "mailserver"

+1 subject "hamster" "newsserver" "mailserver"

Patterns with a leading "+"-sign mean, that the field has to contain this value:

# "hamster" in combination with "newsserver" or "mailserver"

+1 subject +"hamster" "newsserver" "mailserver"

Patterns with a leading "-"-sign mean, that the field may not contain this value:

# "newsserver" or "mailserver" not regarding "unix/linux/inn"

+1 subject "newsserver" "mailserver" -"unix" -"linux" -"inn"

# From-headers not containing "@"

=-9999 from -"@"

To combine different header-fields in a score-line, you can qualify the pattern with its name:

-1 subject "help" "urgent" "!!!" -@from:"my@address" -"SCNR"

If a score-pattern is placed within "{...}", it is treated as a PCRE-style regular expression[*]:

# Ignore those who want to be ignored:

-1 from {no.?spam} {(remove|delete|cut).*this}

[*] Perl-documentation for regular expressions can be found at:

   http://www.perl.com/CPAN-local/doc/manual/html/pod/perlre.html

Example:

# A section starting with "[*]" contains global score-entries, which will be

# used for all groups:

[*]

# Load "my" articles immediately:

=+9999 From "Your Name"

=+9999 Message-ID your.unique.fqdn

# Load articles referencing one of "my" articles:

=+5000 References your.unique.fqdn

# Certainly, we are very interested in articles regarding these funny little

# animals with small antennas on the head:

=+1000 Subject hamster "HELP! THERE'S A BIG FAT RAT ON MY SCREEN!" "SCNR ;-)"

# And certainly, we ignore really silly suggestions such as:

=-1000 Subject "MAKE HAMSTER FAST!!!!"

# (please notice, that this entry would never match, as subjects containing

# "hamster" would match the "="-entry above)

# The examples below use group-specific score-entries by starting a new

# section in the scorefile with a "[...]"-line.

# As Hamster builds an "individual" scorelist for each group before loading

# articles for it, it is more effective to define "individual" filters, if

# score-entries are only needed for some of the groups.

# Filter out "big" articles, that do not have "FAQ" in subject and are not

# posted in an announce-group:

[* -announce]

-10 Lines %>200

-10 Bytes %>10000

+20 Subject FAQ

# Ignore articles posted to more than three groups:

-10 Xpost %>3

# Ignore articles with subjects containing "!!!" in all groups except the

# newusers-groups:

[* -newusers -neubenutzer]

-1 Subject "!!!"

# Some groups may be more readable, if you filter out all articles and

# only load specific ones immediately, e.g.:

[group.name.one group.name.two group.name.three]

-1 Message-ID *

+1 Subject "interest1" "interest2" "interest3" "interest4"

+1 From "user1" "user2" "user3" "user4"


MailFilt.hst (mail-filters)
File: (root)\MailFilt.hst

Purpose:

The rules in file "MailFilt.hst" determine, which mails are loaded from POP3-servers (1.) and what to do with them after they have been loaded (2.):

1.) To load or not to load ...

If the filter-file contains "ignore"- or "kill"-rules, Hamster first tries to load the headers of the available mails, and only if the rules finally say "yes, it's ok to load them", the mails will be loaded completely and will be delivered to their final destination.

- Each mail starts with "yes, it's ok to load it".

- If a "ignore"-rule matches, the mail will not be loaded and will not be deleted.

- If a "kill"-rule matches, the mail will not be loaded but will be deleted.

- If a "load"-rule matches, a previous matching "ignore" or "kill" is revoked.

By default, "ignore" and "kill" work silent, so only Hamster knows, if and which messages were really ignored or killed. To enable notification-messages for each mail that was ignored or killed, add a "notify"-line.

Note: The "[X] Leave mails on server, i.e. do not delete them"-setting has a higher priority than the rules given here in the filter-file, so even if a rule says "delete this mail", it won't be deleted if this setting is activated.

2.) Recipient wanted, dead or alive ...

After a mail was loaded, it has to be delivered to its final destination. The second group of rules determine, in which local account-mailbox(es) or in which local newsgroup(s) the mail is stored.

- Each mail starts with an empty recipient- and newsgroups-list.

- If an "add"-rule matches, the given recipient(s) will be added to the recipient-list.

- If a "del"-rule matches, the given recipient(s) will be removed from the recipient-list.

- If a "set"-rule matches, the recipient-list will be replaced by the given recipient(s).

- If a "postto"-rule matches, the given newsgroup(s) will be added to the newsgroups-list.

The "addaccounts"-rule checks the given header-field, if it contains mail-addresses known by Hamster. If a local mail-address is recognized (especially one of the "Local mail-addresses" defined under "Local accounts"), the corresponding account is added to the recipient-list.

If both the recipient-list and the newsgroups-list is still empty after all rules have been tested, the mail is not lost but always sent to a default-account. This default-account is always "admin" unless another default-user is given by the last parameter of a fetchmail/ControlRunFetchMail-scriptcommand or with a "default"-line in the filter-file.

Syntax-Overview:

MFilterFile     =  *( MFilterBlock / cEOL )

MFilterBlock    =  MFilterScope *( MFilterRule / cEOL )

MFilterScope    =  "[" ScopePattern *( 1*WSP ScopePattern ) "]" cEOL

MFilterRule     =  ["="] ( MRuleLoad / MRuleDeliver ) cEOL

MRuleLoad       =  "load"   [ "("             ")" ] 1*WSP MSelection

MRuleLoad       =/ "ignore" [ "("             ")" ] 1*WSP MSelection

MRuleLoad       =/ "kill"   [ "("             ")" ] 1*WSP MSelection

MRuleLoad       =/ "notify" [ "(" AccountList ")" ]

MRuleDeliver    =  "default"       "(" AccountList   ")"

MRuleDeliver    =/ "addaccounts" [ "("               ")" ] 1*WSP MDefaultField

MRuleDeliver    =/ "add"           "(" AccountList   ")"   1*WSP MSelection

MRuleDeliver    =/ "set"           "(" AccountList   ")"   1*WSP MSelection

MRuleDeliver    =/ "del"           "(" AccountList   ")"   1*WSP MSelection

MRuleDeliver    =/ "postto"        "(" NewsgroupList ")"   1*WSP MSelection

MSelection      = MDefaultField 1*( 1*WHSP MSelectPattern )

MDefaultField   = [ "~" ] [ "*" ] ( MSingleField / MGroupedField )

MSingleField    = ( <Name of any header-field> / "Bytes" ) [ ":" ]

MGroupedField   = ( "Any-Sender" / "Any-Recipient" )

MSelectPattern  = [ "+" / "-" ] [ "@" MSingleField ":" ] Pattern

AccountList     =  <account-name>   *( "," <account-name>   )

NewsgroupList   =  <newsgroup-name> *( "," <newsgroup-name> )

ScopePattern    = [ "+" / "-" ] Pattern

Pattern         = ( PatRegExp / PatSimple )

PatRegExp       = "{" <PCRE-style regex-pattern> "}"

PatSimple       = ( PatSimpleAll / PatSimpleText / PatSimpleNumber )

PatSimpleAll    = "*"

PatSimpleText   = """ <Text> """

PatSimpleNumber = "%" ( "<" / "=" / ">" ) <Number>

cEOL            = [ "#" <Comment> ] CRLF

Filter-Scope:

Each block starts with a "[...]"-header describing the identifiers, for which the following filter-rules should be tested.

The only way to set such an identifier is the last parameter of a fetchmail/ControlRunFetchMail-scriptcommand, e.g.: fetchmail "pop3.serv.er" "pop3" "$7" "" "admin,identifier"

[*]

# filter-rules for all mails, regardless of identifier used

[private]

# filter-rules for all mails fetched with identifier "private"

[* -private]

# filter-rules for all mails except those fetched with identifier "private"

Filter-Rules:

Note: The following description only covers the main differences between mail- and news-filters. For details on selection and patterns see Scores.hst.

Unlike news-filters, each rule starts with a specific keyword followed by its parameters within parenthesis:

kill()                   From: "well.known@spamm.er"

add(john)                To:   "john@mail.serv.er"

postto(hamster.ehamster) To:   "ehamster@onelist.com"

The special field-name "Bytes" allows testing based on the size of the mail:

ignore() Bytes: %>100000

The special field-name "Any-Sender" checks all of the following headers: "From:", "Apparently-From:", "Sender:", "Reply-To:", "X-Sender:", "Envelope-From:" and "X-Envelope-From:":

load() Any-Sender: "boss@compa.ny" -@Subject:"You are fired!"

The special field-name "Any-Recipient" checks all of the following headers: "To:", "Apparently-To:", "CC:", "BCC:", "Envelope-To:" and "X-Envelope-To:".

add(john) Any-Recipient: "john@mail.serv.er"

add(jane) Any-Recipient: "jane@mail.serv.er"

addaccounts() Any-Recipient:

If a fieldname is preceded with "~", the value of the given field is MIME-decoded before testing:

load() ~To: "jürgen"

By default, only the first header-line with the given name is tested. If a fieldname is preceded with "*", all header-lines with this name are tested:

add(john) *Received: "john@"

Examples:

Deliver mails based on known local mail-addresses:

[*]

addaccounts() Any-Recipient:

addaccounts() *Received:

Send mails of Hamster-mailinglists to local newsgroups - and a copy of each mail to "admin", until you know if it works as expected ...:

[*]

postto(hamster.ml.usehamsternet) To: "usehamsternet@onelist.com"

add(admin)                       To: "usehamsternet@onelist.com"

postto(hamster.ml.ehamster) To: "ehamster@onelist.com"

add(admin)                  To: "ehamster@onelist.com"


Hamster-Scripts Vr. 2
Hamster-Scripts Vr. 2 (*.hsc)

Please note:

To use Hamster-Scripts Vr. 2, the first line of a script has to be:

#!hs2

This line determines, with which script-engine the script is executed, and

if this line is missing, Hamster assumes, that it is still an old-style script.

 Syntax-Overview

 Data-Types

 Operators

 Variables

 Preprocessor-Commands

 Statements

 Functions (built-in)

 Functions (self-defined)

 Functions (Hamster)

 Modules


Syntax-Overview (scripts)
Hamster-Scripts: Syntax-Overview

Code-lines

The syntax of Hamster-Scripts is line-oriented, which means, that each statement has to be written in a single line of text (the length of each line is in fact not limited):

Allowed:	print( uppercase( "This is a single line" ) )
Not allowed:	print(    uppercase( "This is NOT a single line" )  )

Long lines may be split into multiple lines by appending the line-continuation marker "_" to the end of the line. When the script is started, this marker is replaced by a space and the following line-break (and leading whitespace) is removed, so internally this becomes a single line again:

Allowed:	print( _    uppercase( _       "You won't believe it, but this is a single line, too!" _    ) _ )

Comments

Comments start with a "#" character, the rest of the line is ignored:

Allowed:	# And now, a secret about spammers: print( uppercase( "make money fast" ) ) # They don't have shift-keys!
Not allowed:	print( _    uppercase( "make money fast" ) _ # Not allowed within a line! )

There's also a second type of comments, which may be inserted even within a line. These embedded comments are written between {braces}:

Allowed:	print( _    uppercase( "make money fast" ) _ {comment within splitted line} )


Data-Types (scripts)
Hamster-Scripts: Data Types

Scalars

Hamster uses a variant data-type, which can contain two basic scalar data-types: Strings or Integer.

Strings can contain any sequence of ASCII-characters, even NUL (ASCII 0). Each String can be as long as your RAM and swapfile allows. String-constants are written within double quotation marks ("...").

Integers are signed 32-Bit and can contain numbers in the range of  -2147483648 to 2147483647. Integer-constants in hex are written with a leading "0x" (a zero-digit and a small letter "x", e.g. 0xFF).

Integers are also used to represent boolean values, where a value of 0 means FALSE and all other values mean TRUE (all built-in functions, especially "true", return a value of 1 in this case).

Where applicable, the data-types are converted automatically when needed, so if an integer is used in a string-context, it is converted to a string and vice versa.

Arrays, Hashes, Collections, Lists

There are no such data-types in Hamster-Scripts, but in many cases they can be replaced or at least be simulated by a set of list-functions. In this case, these lists are maintained internally and are accessed through a unique list-handle. See "ListAlloc" et. al. for details.


Operators (scripts)
Hamster-Scripts: Operators

Overview

Operators	Precedence	Associativity	Data-types
(  )	(highest)	<--	int, str
!  ~  +  -  (unary)	.	-->	int
*  /  %	.	<--	int
+  -	.	<--	int, str (+ only)
<<  >>	.	<--	int
<  >  <=  >=	.	<--	int, str
==  =  !=  <>	.	<--	int, str
&	.	<--	int
^	.	<--	int
|	.	<--	int
&&	.	<--	int
||	(lowest)	<--	int

Details

Operators	Description
(  )	group
!	logical negation
~	binary negation (complement)
+ (unary)	sign
- (unary)	sign
*	multiplication
/	division
%	modulus
+	addition, string-concatenation
-	subtraction
<<	binary shift left
>>	binary shift right
<	smaller than
>	greater than
<=	smaller or equal
>=	greater or equal
==  =	equal
!=  <>	not equal
&	binary AND
^	binary XOR
|	binary OR
&&	logical AND
||	logical OR


Variables (scripts)
Hamster-Scripts: Variables

All variables start with a single dollar-sign ("$") followed by a letter ("A"..."Z", "a"..."z"). Further characters may also contain digits ("0"..."9") or underscores ("_").

The length of a variable-name is (in fact) not limited and all characters are significant, but upper- and lowercase characters are treated the same, so $ABC is exactly the same variable as $abc.

Examples for valid variables:

$a

$i________

$a_b

$The_answer_is_REALLY_42

Examples for invalid variables:

a$

      ^^

$____i____

       ^

$a.b

        ^

$The_answer_is_REALLY_42!!!

                              ^^^

$1st_cut

       ^


Preprocessor-Commands (scripts)
Hamster-Scripts: Preprocessor-Commands

Preprocessor-Commands are special commands that are execute before the script is started. If used, they should preferably be located at the very beginning of the script.

#!hs2

This command is ignored and might be removed in a future script-version, but if a Hamster-Script is executed by Hamster, it has to be the first line of each script. It is the marker, which decides to use the new script-engine and not the old one.

#!trace 1

For testing-purposes, all lines will be displayed as they are executed. Although there's also a "trace"-command to enable and disable tracing, this preprocessor-command is the only way to trace the preprocessor-phase. It shows, for example, the initialization-sequences of loaded modules.

#!debug <level>

Sets the debug-level, with which the script is executed. Default is "#!debug 0", which means, that all "debug"-commands within the scripts should be ignored.

#!load module.hsm

This command loads and initializes the given module and its dependants (if any). See Modules for details.

#!initialize

This command is used in modules and marks its initialization code. See Modules for details.


Statements (scripts)
Hamster-Scripts: Statements

Statements are functions, which cannot be used within expressions. Most of them control the flow of the script.

quit( <exitcode> )

quit

Terminates a running script. The optional parameter sets the exit-code (default: 0), which has no special meaning yet when used in Hamster.

quit

error( <errmsg> )

error

Terminates a running script with the given error-message (default: "User defined error!").

error( "File ", $Filename, " not found!" )

assert( <assertion>, <errmsg> )

assert( <assertion> )

Terminates a running script with the given error-message (default: "Assertion failed!"), if <assertion> returns a value of 0 (FALSE).

assert( FileExists($Filename), "File ", $Filename, " not found!" )

return( <retval> )

return

Leaves a "sub" and sets its return-value (default: 0). If used outside of a "sub", the script is terminated.

return( 42 )

return( uppercase("fortytwo") )

endsub

Same as "return" without parameter, i.e. it leaves a "sub" with a return-value of 0.

endsub

var( <variable> [ , <variable> ... ] )

Declares the given variables before they can be used. The initial value of new variables is undefined, already existing ones are reset to an undefined state. See also: "varset"

var( $a, $b, $c )

entercontext( <identifier> )

leavecontext

A "context" defines the scope for which variables are valid. If a new context is created (entercontext), all variables created in this context are local to it, and if the context is left (leavecontext), they will be deleted. You never should need these statements, as they are automatically invoked while a "sub" is executed (i.e. each sub has its own, local variables).

var( $a )

$a = 42

entercontext( "test" )

var( $a )

$a = 999

leavecontext

print( $a ) # its value is still 42

label( <identifier> )

Marks a position in the script with the given identifier. It is used as the target for "goto" and "gosub".

label( never_call_me_with_a_goto_please )

goto( <identifier> )

Looks for a "label" with the given identifier and continues execution right after it.

goto( GOTOs_are_REALLY_ugly )

if( <condition> )

else

endif

If <condition> gives a value other than 0 (=TRUE), the lines between "if" and "else" are executed, and if it returns 0 (=FALSE), the lines between "else" (if any) and "endif" are executed.

if( $answer = 42 )

   print( "The answer is correct!" )

else

   print( "The answer is wrong!" )

   if( $whoanswered = "Deep Thought" )

      print( "Reinstall Windows!" )

   endif

endif

do

while( <condition> )

repeat

Marks the beginning of a loop. If "while" is used, the loop is only started, if <condition> returns a value other than 0 (read as: while condition is true).

# see examples under loop/endwhile/until and break/continue

loop

endwhile

until( <condition> )

Marks the end of a loop. If "until" is used, the loop is only stopped, if <condition> returns a value other than 0 (read as: until condition is true).

do

   # ...

loop

while( $i<10 )

   # ...

endwhile

repeat

   # ...

until( $i>10 )

while( $i<10 )

   # ...

until( $k=42 )

for( <loop-var>, <limit1>, <limit2>, <step> )

for( <loop-var>, <limit1>, <limit2> )

Marks the beginning of a "for"-loop.

When the loop is started, the variable <loop-var> is initialized with <limit1>.

The code between "for" and "endfor" is then executed while the value of <loop-var> is lower or equal to <limit2>, or - if <step> is negative - while the value of <loop-var> is greater or equal to <limit2>.

After each loop-run, the value <step> (default: 1) is added to <loop-var>.

var( $i, $k )

for( $i, 1, 10 )

   for( $k, 10, 1, -1 )

      print( $i, " ", $k )

   endfor

endfor

endfor

Marks the end of a "for"-loop.

# see example at for

break( <condition> )

break

Exits a loop. If a <condition> is given, the loop is only exited, if the <condition> returns a value other than zero (read as: break if condition is true).

do

   break( RasIsConnected )

   # do other things

loop

continue( <condition> )

continue

Continues with next loop-run. If a <condition> is given, the loop is only continued, if the <condition> returns a value other than zero (read as: continue if condition is true).

$i = 0

repeat

   continue( $i = 42 )

   inc( $i )

until( $i > 100 )

sleep( <millisecs> )

Waits the given amount of milliseconds (1/1000 seconds).

sleep( 60000 ) # 1 minute

trace( <onoff> )

If tracing is turned on, all script-lines are displayed while they are executed. If <onoff> is 0 (false), tracing is turned off, otherwise it is turned on.

trace( 1 )

# ...

trace( 0 )

dump

Display all variables with their values for testing-purposes.

dump

debug( <level>, <text> [ , <text> ...] )

debug( <level> )

If only a <level> is given, the current debug-level is set to the given value (a value of 0 turns off displaying debug-messages).

If additional <text> is given, this <text> is only displayed, if the current debug-level is greater or equal to the given <level>.

debug( 255 )

debug( 1, "Counter: ", $Counter )


Functions, built-in (scripts)
Hamster-Scripts: Functions (built-in)

Function groups:

Variables

Integers

Strings

Time

Error-handling

Files and directories

Lists

Input/Output

Scheduler

RAS

Miscellaneous

Variables

set( <variable>, <expression> )

<variable> = <expression>

Sets the given <variable> to the result of the <expression>.

The second, more readable form, is only allowed at the beginning of a line, as "=" would be interpreted as the comparison-operator if used in expressions.

Returns: Result of expression, i.e. the value the variable was given.

var( $a )

set( $a, 42 )

$a = 42

varset( <variable>, <expression> )

Declares a <variable> like "var" and sets its inital value to the result of the given <expression>.

Returns: Result of expression, i.e. the value the variable was given.

VarSet( $a, 42 )

inc( <variable>, <count> )

inc( <variable> )

dec( <variable>, <count> )

dec( <variable> )

Increments ("inc") or decrements ("dec") the given variable by 1 or by the given <count>.

Returns: New value of variable.

inc( $a )

dec( $a, 2 )

Integers

true

Gives a value representing a boolean value of TRUE.

Please note, that all values other than 0 represent TRUE, so "true" does in fact only give "an example" of a TRUE-value.

Returns: 1

$a = true

false

Gives the value representing a boolean value of FALSE.

Returns: 0

$a = false

isint( <expression> )

Solves the given expression and returns true if the result is an integer.

Returns: 1, if expression represents an integer-value, 0 otherwise

$result = iif( isint($a), $a, 0 )

int( <expression> )

Converts the given <expression> into an integer. If it is a string starting with "0x", the rest of the string is considered to be a hex-value.

Returns: Integer-value; 0 if string does not contain a valid integer.

$a = "1"

$b = 2

$c = $a + $b       # -> "12"

$d = int($a) + $b  # -> 3

print( int("0xFF") )  # -> 255

abs( <number> )

Returns the absolute value of <number>.

Returns: Integer.

print( abs( 42) )  # -> 42

print( abs(-42) )  # -> 42

sgn( <number> )

Returns -1 if <number> if negative, +1 if it's positive and 0 if it's 0.

Returns: Integer.

print( sgn( 42) )  # -> 1

print( sgn(-42) )  # -> -1

Strings

isstr( <expression> )

Solves the given expression and returns true if the result is a string.

Returns: 1, if expression represents a string-value, 0 otherwise

$result = iif( isstr($a), $a, "0x"+hex($a) )

ord( <string> )

Returns the ASCII-number of the first character of <string>.

Returns: Number (0 if string is empty).

print( ord("*") )  # -> 42

chr( <number> )

Returns the ASCII-character of <number>.

Returns: String containing 1 character.

print( chr(42) )  # -> "*"

str( <number>, <length>, <leadchar> )

...

str( <number> )

Converts the given number into a string. If <length> is given, the string is padded with leading <leadchar>'s (default: "0") up to the given length.

Returns: String.

$a = 42

print( str( $a         ) )  # -> "42"

print( str( $a, 5      ) )  # -> "00042"

print( str( $a, 5, " " ) )  # -> "   42"

hex( <number>, <digits> )

hex( <number> ] )

Converts the given number into hex. If <digits> is given, the string is padded with leading "0"'s up to the given length.

Returns: String.

$a = 42

print( hex( $a, 42 ) )          # -> "002A"

print( int( "0x" + hex(42) ) )  # -> 42

len( <string> )

Returns the length of the given string.

Returns: Integer.

print( len("abc") )  # -> 3

pos( <substr>, <string>, <startpos> ] )

pos( <substr>, <string> )

Returns the position of <substr> within <string>. If a <startpos> is given, positions lower than this value are ignored.

Returns: Position or 0, if not found.

print( pos( "b", "abcde" ) )     # -> 2

print( pos( "b", "abcde", 3 ) )  # -> 0

copy( <string>, <startpos>, <length> ] )

copy( <string>, <startpos> )

Returns the part of <string>, which starts at <startpos>. If no <length> is given, the rest of the string is returned.

Returns: String.

print( copy( "abcde", 3, 1 ) )  # -> "c"

print( copy( "abcde", 3 ) )     # -> "cde"

delete( <string>, <startpos>, <length> ] )

delete( <string>, <startpos> )

Deletes the part of <string>, which starts at <startpos>. If no <length> is given, the rest of the string is deleted.

Returns: String.

print( delete( "abcde", 3, 1 ) )  # -> "abde"

print( delete( "abcde", 3 ) )     # -> "ab"

$s = delete( $s, 1, 1 )  # delete 1st char of $s

trim( <string>, <trimchars> )

trim( <string> )

Removes all leading and trailing characters from <string>, that are contained in <trimchars>. If no <trimchars> are given, leading and trailing spaces are removed.

Returns: String.

print( trim("  42  ") )  # -> "42"

$WHITESPACE = " " + chr(9)

print( trim( $line, $WHITESPACE ) )

lowercase( <string> )

Converts all upper-case characters within <string> to lower-case characters.

Returns: String.

print( lowercase( "AbCd" ) )  # -> "abcd"

uppercase( <string> )

Converts all lower-case characters within <string> to upper-case characters.

Returns: String.

print( uppercase( "AbCd" ) )  # -> "ABCD"

replace( <string>, <find>, <replace>, <all>, <ignorecase> )

...

replace( <string>, <find>, <replace> )

Looks for <find> within <string> and, if found, replaces it with <replace>. If <all> is given and has a value other than 0, all occurances of <find> are replaced. If <case> is given and has a value other than 0, upper-/lowercase is ignored for finding.

Returns: String.

print( replace( "abcABCabc", "b", "[X]" )             )  # -> "a[X]cABCabc"

print( replace( "abcABCabc", "b", "[X]", true )       )  # -> "a[X]cABCa[X]c"

print( replace( "abcABCabc", "b", "[X]", true, true ) )  # -> "a[X]cA[X]Ca[X]c"

eval( <string> )

Treats <string> as an expression, solves it and returns its value.

Returns: Result of expression.

print(       "4" + "+" + "2"   )  # -> "4+2"

print( eval( "4" + "+" + "2" ) )  # -> 6

RE_Match( <string>, <regex> )

Returns TRUE if <string> matches the (PCRE-style) regular expression <regex>.

NOTE: Upper-/lowercase is ignored by default. To make it case-sensitive, precede <regex> with a "(?-i)"-flag.

Returns: TRUE (1), FALSE (0)

$answer = "abc4efg2hij"

if( RE_Match( $answer, "4.*2" ) )

   print( "OK, it looks acceptable." )

endif

RE_Extract( <string>, <regex> )

Returns the part of <string>, which matches the (PCRE-style) regular expression <regex>.

NOTE: Upper-/lowercase is ignored by default. To make it case-sensitive, precede <regex> with a "(?-i)"-flag.

Returns: String (empty string, if not found)

$answer = "abc4efg2hij"

print( RE_Extract( $answer, "4.*2" ) )  # -> "4efg2"

print( RE_Extract( $answer, "A.*C"      ) )  # -> "abc"

print( RE_Extract( $answer, "(?-i)A.*C" ) )  # -> ""

RE_Parse( <string>, <regex>, <var1> [ , <var2> ... ] )

Splits <string> into groups defined by (PCRE-style) regular expression <regex>, where a group of characters is placed within parenthesis.

First group is stored in variable <var1>, second in <var2> and so on.

If a given <var#>-parameter is not a variable, the part is ignored.

If <string> does not contain enough groups, the given <vars> are set to empty strings.

NOTE: Upper-/lowercase is ignored by default. To make it case-sensitive, precede <regex> with a "(?-i)"-flag.

Returns: TRUE (1): OK, FALSE (0): Error (e.g. invalid <regex>)

$line = "Subject: This is a test"

RE_Parse( $line, "(\S+:)\s+(.*)", $a, $b )  # -> $a="Subject:", $b="This is a test"

RE_Split( <string>, <regex>, <var1>, <var2> [ , <var3> ... ] )

Splits <string> into parts separated by the (PCRE-style) regular expression <regex>.

First part is stored in variable <var1>, second in <var2> and so on. Last variable always receives the remainder of the string, even if it contains further parts separated by <regex>.

If a given <var#>-parameter is not a variable, the part is ignored.

If <string> does not contain enough parts, the given <vars> are set to empty strings.

NOTE: Upper-/lowercase is ignored by default. To make it case-sensitive, precede <regex> with a "(?-i)"-flag.

Returns: TRUE (1): OK, FALSE (0): Error (e.g. invalid <regex>)

$line = "this  is    a   test"

RE_Split( $line, " +", $a, $b )      # --> $a="this", $b="is    a   test"

RE_Split( $line, " +", $a, $b, $c )  # --> $a="this", $b="is", $c="a   test"

Time

ticks

Retrieves the number of milliseconds that have elapsed since Windows was started.

Returns: Integer.

$start = ticks

# ...

$stop = ticks

print( "It took ", $stop - $start, "ms." )

time

Retrieves the current date and time (local time).

Returns: Integer (Unix-format, i.e. seconds since Jan 1st 1970).

$now = time

$yesterday = $now - 24*60*60

timegmt

Retrieves the current date and time (GMT).

Returns: Integer (Unix-format, i.e. seconds since Jan 1st 1970).

$nowgmt = timegmt

decodetime( <time>, <yyyy>, <mm>, <dd>, <hh>, <nn>, <ss>, <wd> )

...

decodetime( <time>, <yyyy> )

Decodes the given <time>. Other parameters are ignored, unless they are variables. In this case, the given variable is set to one of the decoded values: <yyyy> (year), <mm> (month), <dd> (day), <hh> (hour), <nn> (minute), <ss> (seconds), <wd> (day of week; 1=Sunday, ..., 7=Saturday).

Returns: <time>

var( $hrs, $min, $sec )

decodetime( time, 0, 0, 0, $hrs, $min, $sec )

print( "Current time: ", $hrs, ":", $min, ":", $sec )

encodetime( <yyyy>, <mm>, <dd>, <hh>, <nn>, <ss> )

Returns a time-value build from the given parameters.

Returns: <time>

encodetime( 2000, 12, 31, 23, 59, 59 )

Error-handling

ErrCatch( <on/off> )

ErrCatch

If <on/off> is TRUE (<>0), error-catching is enabled. This means, that all errors, which normally stop the script immediately, are ignored. If an error happens in this state, "ErrNum" will return a value other than 0.

If <on/off> is FALSE (=0), error-catching is disabled again, i.e. the script will be stopped again if an error happens.

"ErrCatch" without parameters just returns the current state. It may be used to preserve the current state while executing a "dangerous" part of a script.

Returns: 0/False: Disabled (default; i.e. stop on errors), 1/True: Enabled (ignore errors)

$OldErrCatch = ErrCatch

ErrCatch( True )

print( 42/0 )  # division by zero causes error

if( ErrNum<>0 )

   print( "Error: ", ErrNum, " ", ErrMsg )

endif

ErrCatch( $OldErrCatch )

ErrNum

Returns error-number of last error.

NOTE: Do not rely on the numbers returned, they might be changed in a future version.

Returns: Integer (=0: No error, <>0: Error)

if( ErrNum <> 0 )

   # ...

endif

ErrMsg

Returns error-description of last error.

Returns: String

print( ErrMsg )

ErrModule

Returns name of module in which last error occured.

Returns: String

print( ErrModule )

ErrLineNo

Returns line number within module in which last error occured.

Returns: Integer

print( ErrLineNo )

ErrLine

Returns script-line which raised last error.

Returns: String

print( ErrLine )

ErrSender

Returns name of script-object which raised last error.

Returns: String

print( ErrSender )

Files and directories

execute( <cmdline>, <workdir>, <show>, <wait>, <exitcode> )

Starts the program given in <cmdline>, which also can contain parameters and options needed by this program. If <workdir> is given, it is set as the workding-directory for the started program. <show> controls, how the started program is shown (0=hidden, 1=default=normal, 2=minimized, 3=maximized). If <wait> is set to true (default), execution of the script is paused until the started program has finished. If the exit-code of the program is needed, it can be saved in the variable <exitcode>.

Returns: Integer (0=no error, <>0=error)

execute( "notepad.exe myfile.cfg" )

IniRead( <filename>, <section>, <ident>, <default> )

Reads an entry from the .INI-file named <filename>. If no <filename> is given, file "HScripts.ini" is used. If no <section> is given, section "[All]" is used.

If "[<section>]" does not contain an entry named "<ident>=...", the value <default> is returned.

Returns: String

$answer = IniRead( "MyScript.ini", "Answers", "Last", "42")

$LastConnected = int( IniRead( "", "", "LastConnected", 0 ) )

IniWrite( <filename>, <section>, <ident>, <value> )

Writes an entry to the .INI-file named <filename>. If no <filename> is given, file "HScripts.ini" is used. If no <section> is given, section "[All]" is used.

Returns: String (<value>)

IniWrite( "MyScript.ini", "Answers", "Last", $answer )

IniWrite( "", "", "LastConnected", time )

FileExists( <filename> )

Checks, if the given file exists. <filename> may contain wildcards "?" and "*".

Returns: Integer (1=exists, 0=doesn't exist or invalid filename/path)

if( !fileexists("myfile.cfg" ) )

   error( "Missing configuration file!" )

endif

FileSize( <filename> )

Returns size of file <filename>.

Returns: Integer (-1 if file is missing)

print( FileSize( HamPath + "Hamster.exe" ) )

FileTime( <filename> )

Returns time of last update of file <filename>.

Returns: Integer (-1 if file is missing)

print( "Your Hamster's age: ", time - FileTime( HamPath + "Hamster.exe" ), " seconds" )

FileDelete( <filename> )

Deletes the file named <filename>.

Returns: 0: OK, <>0: Error

FileDelete( "MyScript.tmp" )

FileRename( <oldname>, <newname> )

Renames the file named <oldname> to <newname>.

Returns: 0: OK, <>0: Error

FileRename( "MyScript.dat", "MyScript.bak" )

FileCopy( <oldname>, <newname> )

Copies the file named <oldname> to <newname>.

Returns: 0: OK, <>0: Error

FileCopy( "MyScript.dat", "MyScript.bak" )

DirExists( <dirname> )

Checks, if the given directory exists.

Returns: Integer (1=exists, 0=doesn't exist or invalid path)

if( !direxists( "mydir" ) )

   # ...

endif

DirMake( <dirname> )

Creates a new directory named <dirname>.

Returns: 0: OK, <>0: Error

DirMake( HamPath + "MyScript" )

DirRemove( <dirname> )

Removes the directory named <dirname>, if it is empty.

Returns: 0: OK, <>0: Error

DirRemove( HamPath + "MyScript" )

DirChange( <dirname> )

Makes the directory named <dirname> the current directory.

NOTE: Not suggested, use full qualified filenames instead.

Returns: 0: OK, <>0: Error

DirChange( HamPath + "MyScript" )

DirCurrent

Returns the name of the current directory. The name is always returned with a trailing backslash.

Returns: 0: OK, <>0: Error

print( DirCurrent )

DirWindows

Returns the name of the Windows directory. The name is always returned with a trailing backslash.

Returns: 0: OK, <>0: Error

print( DirWindows )

DirSystem

Returns the name of the Windows system directory. The name is always returned with a trailing backslash.

Returns: 0: OK, <>0: Error

print( DirSystem )

See also: ListLoad, ListSave, ListFiles, ListDirs.

Lists

ListAlloc( <sorted>, <duplicates> )

...

ListAlloc

Creates a new list of strings and returns a unique handle for it. This handle is noted as <list> in the other list-functions described below and is valid until the list if freed again by "ListFree".

If <sorted> is set to TRUE (<>0), the list is automatically sorted when adding new entries (default is: not sorted).

If <duplicates> is set to TRUE (<>0), duplicate entries are allowed and will be accepted (default), otherwise they will be ignored, so each entry becomes unique. Note, that this only works for sorted lists.

Returns: >=0: list-handle, -1: too many lists.

$list = ListAlloc

ListFree( <list> )

Frees a list created by "ListAlloc".

Returns: 0: OK, -1: invalid list-handle

listfree( $list )

ListExists( <list>, <index> )

ListExists( <list> )

Checks, if <list> points to a valid list. If <index> is given, it also checks, if the list has an entry for this index.

Returns: 1/true: is valid; 0/false: invalid

sub DoSomethingWithList( $list )

   if( !ListExists( $list )

      error( "List expected!" )

   endif

   # ...

endsub

ListClear( <list> )

Deletes all entries in the given list.

Returns: 0: OK; -1: invalid list-handle

ListClear( $list )

ListCount( <list> )

Returns the number of list-entries.

Returns: number of list-entries

print( ListCount( $list ) )

ListGet( <list>, <index> )

Returns the string with the given <index>. Entries are numbered from 0 to (ListCount-1).

Returns: String (empty string, if list or index was invalid)

$i = 0

while( $i < ListCount($list) )

   print( $i, ": ", ListGet($list,$i) )

   inc( $i )

endwhile

ListSet( <list>, <index>, <value> )

ListSet( <list>, <index> )

Changes the value of the list-entry at <index>. If no <value> is given, it is set to an empty string.

If the list does not contain enough entries yet, they are automatically created as empty strings, so the list can be used like an open array of strings.

Returns: <value>

ListSet( $list, 42, "The answer!" )

ListGetTag( <list>, <index> )

Returns the "Tag"-value of the string at the given <index>. A "Tag"-value is just a number associated with each entry.

Returns: Integer

$entry_itself = ListGet( $list, 42 )

$tag_of_entry = ListGetTag( $list, 42 )

ListSetTag( <list>, <index>, <tag> )

Sets the "Tag"-value of the string at the given <index>.

Returns: <tag>

$index = ListAdd( $list, "The answer!" )

ListSetTag( $list, $index, 42 )

ListGetKey( <list>, <key> )

If the list contains strings in the form "key=value", this command returns the value of key <key>.

Returns: String

# see example under ListSetKey

ListSetKey( <list>, <key>, <value> )

ListSetKey( <list>, <key> )

If the list contains strings in the form "key=value", this command sets the value of key <key>. If no value is given, it is set to an empty string.

Returns: <value>

$list = ListCreate

ListSetKey( $list, "RTFM", "Read the f... manual!" )

ListSetKey( $list, "SCNR", "Sorry, could not resist!" )

print( ListGetKey( $list, "SCNR" ) )

ListAdd( <list>, <value> )

ListAdd( <list> )

Appends a new entry with the given <value> (default: empty string).

Returns: Index of new entry.

$index = ListAdd( $list, $text )

ListDelete( <list>, <index> )

Deletes the entry with the given <index>.

Returns: 0

$index = ListAdd( $list, $text )

ListInsert( <list>, <index>, <value> )

ListInsert( <list>, <index> )

Inserts a new entry with the given value (default: empty string) at the given <index>.

Returns: 0

ListInsert( $list, 0, $text )

ListSort( <list> )

Sorts the given list by its values.

Returns: 0

ListSort( $list )

ListSetText( <list>, <text> )

Clears the list and adds an entry for each line of <text>, which is separated by CR+LF.

Returns: <text>

ListSetText( $list, $article )

print( ListGet( $list, 0 ) )  # -> first line of $article

ListGetText( <list> )

Returns a CR/LF-separated text containing all list-entries.

Returns: String

$article = ListGetText( $list )

ListIndexOf( <list>, <value> )

Returns the index of the list-entry, which equals <value>.

Returns: >=0: index, -1: not found

ListSetText( $list, $article )

$EndOfHdr = ListIndexOf( $list, "" )

ListLoad( <list>, <textfile> )

Loads the given <textfile> and creates a list-entry for each line of the file.

Returns: 0: OK, -1: list invalid or file not found

ListLoad( $list, "MyScript.cfg" )

ListSave( <list>, <textfile> )

Saves the list in the given <textfile>.

Returns: 0: OK, -1: list invalid

ListSave( $list, "MyScript.cfg" )

ListFiles( <list>, <filemask>, <fullpath> )

ListFiles( <list>, <filemask> )

Fills the list with the filenames selected by <file-mask>.

If <fullpath> is given and TRUE (<>0), all files are expanded with their pathname, otherwise only the filenames are returned.

Returns: >=0: OK (number of files),<0: list invalid or file not found

ListFiles( $list, HamPath + "Mails\Mail.Out\*.msg", true )

ListDirs( <list>, <filemask>, <fullpath> )

ListDirs( <list>, <filemask> )

Fills the list with the directory-names selected by <file-mask>.

If <fullpath> is given and TRUE (<>0), all directory-names are expanded with their pathname, otherwise only the names are returned.

Returns: >=0: OK (number of files),<0: list invalid or file not found

ListDirs( $list, HamPath + "Mails\*." )

ListRasEntries( <list> )

Fills the list with the names of all RAS phonebook entries.

Returns: >=0: OK (number of entries),<0: list invalid or error

var( $RasConnection )

$RasConnection = SelectRasConnection

if( $RasConnection <> "" )

   print( "Dialing ", $RasConnection )

   # ...

endif

quit

sub SelectRasConnection

   var( $RasList, $RasSelIndex, $RasSelName )

   $RasSelName = ""

   $RasList = ListAlloc

   if( ListRasEntries( $RasList )>0 )

      $RasSelIndex = ListBox( $RasList, "Select connection to use:" )

      if( $RasSelIndex >= 0 )

         $RasSelName = ListGet( $RasList, $RasSelIndex )

      endif

   endif

   ListFree( $RasList )

   return( $RasSelName )

endsub

Input/Output

print( <text> [ , <text> ...] )

Displays the given text.

When used in Hamster, the text is shown as an "Info" (black on white) in the Log-window.

Returns: Printed text.

print( "And the answer is: ", $answer )

warning( <text> [ , <text> ...] )

Same as "print", but the text is displayed in a way that makes it look "more important".

When used in Hamster, the text is shown as a "Warning" (black on yellow) in the Log-window, so it's displayed even if informational messages are disabled there. As a rule of thumb: A user should never see such a warning under normal circumstances.

Returns: Printed text.

warning( "Brain malfunction! No ideas left! Example halted!" )

MsgBox( <text>, <caption>, <style> )

...

MsgBox( <text> )

Displays a message-box with the given <text> and <caption>.

<style> is a number, which determines the type of the message-box and the buttons displayed (default: "Information" with "OK"-button).

Valid types are: 0x40 (Information), 0x30 (Warning), 0x20 (Question), 0x10 (Error)

Valid buttons are: 0x0 (OK), 0x1 (OK+Cancel), 0x2 (Abort+Retry+Ignore), 0x3 (Yes+No+Cancel), 0x4 (Yes+No), 0x5 (Retry+Cancel)

To preselect a specific button add 0x100 for second or 0x200 for third button.

Returns: 0=(error), 1=OK, 2=Cancel, 3=Abort, 4=Retry, 5=Ignore, 6=Yes, 7=No

if( MsgBox( "Do you like silly questions?", "", 0x20|0x4 ) = 6 )

   Error( "Unexpected answer." )

else

   MsgBox( "Then get used to ..." )

endif

InputBox( <text>, <caption>, <default>, <code> )

...

InputBox( <text> )

Displays a window with the given <text> and <caption>. The window contains a text-box which is initialized with <default> (empty string if omitted).

If given, the variable <code> is set to 1 (true) if OK was pressed, and set to 0 (false) otherwise.

Returns: Text entered or empty string if cancelled.

$answer = InputBox( "What's the answer ...?", "", "42", $ok )

ListBox( <list>, <text>, <caption>, <default>, <code> )

...

ListBox( <list>, <text> )

Displays a window with the given <text> and <caption>. The window contains a list-box which is initialized with the strings of list <list>.

If <default> is given (default: -1) and there's an entry in <list> with this index, it is pre-selected.

If given, the variable <code> is set to 1 (true) if OK was pressed, and set to 0 (false) otherwise.

Returns: Index of selected list-entry or <default> if cancelled.

var( $list, $selindex )

$list = ListAlloc

ListAdd( $list, "41" )

ListAdd( $list, "42" )

ListAdd( $list, "43" )

$selindex = ListBox( $list, "What's the answer ...?" )

print( iif( $selindex=1, "Correct!", "Wrong!" ) )

ListFree( $list )

Scheduler

AtClear

Clears all scheduler entries.

Returns: 0

# see example under AtAdd

AtAdd( <subname>, <from>, <til>, <wdays>, <repeat>, <immediate> )

...

AtAdd( <subname>, <from> )

Adds a new scheduler entry.

<subname> gives the name of a user-defined "sub", which is startet when the entry is triggered by "AtExecute".

<from> and <til> contain the time-period, in which the entry is triggered (default for <til> is <from>; format for both is "HH.MM").

<wdays> is a string which contains a marker for each day of the week for which the entry is valid ("1"=valid; first char=Monday, ..., seventh char=Sunday; default="1111111").

If <rep> contains a value greater than 0, the entry is triggered every <repeat> minutes.

If a script is started at a time, for which one of the entries is valid, <subname> is called immediately by default. If <immediate> is set to 0 (false), it is assumed that this event already happend at the time, the entry was added.

Returns: Index of new entry.

AtClear

AtAdd( getmails, "00:00", "06:00", "1111100", 60, true )

AtAdd( getmails, "06:00", "18:00", "1111100", 15, true )

AtAdd( getmails, "18:00", "24:00", "1111100", 60, true )

AtAdd( getmails, "12:00", "",      "0000011" )

AtAdd( getnews,  "03:15" )

AtAdd( getnews,  "18:45" )

AtExecute

quit

sub getmails

   # ...

endsub

sub getnews

   # ...

endsub

AtExecute( <timeout> )

AtExecute

Waits until one of the scheduler-entries added by "AtAdd" is triggered, executes its accompanying sub-function and if this function returns 0, it continues to wait for the next entry to come.

<timeout> gives the maximum time in milliseconds (1/1000 seconds), AtExecute should wait for the next entry.

Returns: -1=timeout, >0: return-value of last executed sub.

# see example under AtAdd

RAS

RasGetConnection

Returns the name (phonebook-entry) of current RAS-connection.

Returns: Name of RAS-connection; "" if not connected.

print( RasGetConnection )

RasIsConnected

Checks current connection-state.

Returns: 1 (true) if connected, 0 (false) otherwise.

if( !RasIsConnected )

   # dial

endif

RasDial( <name>, <user>, <pass>, <connid> )

...

RasDial( <name> )

Dials the RAS-connection named "<name>" and tries to authenticate with username <user> and password <pass>. The connection-handle may optionally be saved in variable <connid>.

NOTE: This function does NOT support any of Hamster's password-options! You have to use the Hamster-specific functions "HamRasDial" and "HamRasHangup" if you want to use them!

Returns: 0: connected; >0: error-code; -1: RAS not installed

$try = 1

while( RasDial("MyProvider","MyUsername","MyPassword") != 0 )

   if( $try >= 3 )

      error( "Dialing failed!" )

   endif

   inc( $try )

   sleep( 10000 )

endwhile

RasHangup( <connid> )

RasHangup

Terminates an existing RAS-connection. If no specific <connid> is given, any current connection is terminated.

Returns: 0: OK; >0: error-code; -1: RAS not installed

RasHangup

RasGetIP

Returns dynamically assigned IP address of current RAS connection.

Returns: IP as string; empty string if not connected.

print( RasGetIP )

See also: ListRasEntries

Miscellaneous

iif( <condition>, <true-result>, <false-result> )

Returns <true-result>, if <condition> is other than zero, <false-result> otherwise.

Returns: As given.

print( iif( $answer="42", "Correct!", "Wrong!" ) )

icase( <value>, <compare1>, <result1> [ , <c2>, <r2> ... ] )

Compares <value> with <compare1>, and if both values are equal, <result1> is returned. Otherwise, all remaining <compare#>/<result#>-pairs are tested the same way, until one matches. The special <compare#>-value "else" matches always, so if used, it should be the last one.

Returns: The selected result or 0 if no pair matched and there was no else-part.

$word = icase( $digit, _

           0, "Zero", 1, "One", 2, "Two", 3, "Three", 4, "Four", _

           5, "Five", 6, "Six", 7, "Seven", 8, "Eight", 9, "Nine", _

           else, "User, we have a problem!" _

        )

gosub( <identifier> )

Looks for a "label" with the given identifier and continues execution right after it. Such a "subroutine" has to be terminated with "return".

Returns: Return-value.

print( gosub( Test ) )

quit

label( Test )

   # ...

return( 42 )


Functions, self-defined (scripts)
Hamster-Scripts: Functions (self-defined)

Creating a function

sub <identifier>( <variable-list> )

sub <identifier>

Starts a user-defined function named <identifier>, which has to start with a letter ("A"..."Z", "a"..."z"). Further characters may also contain digits ("0"..."9") or underscores ("_").

If the function has parameters, they have to be noted as a comma-separated list of variables within parenthesis:

TestSub( 1, "two", 3 )

quit

sub TestSub( $a, $b, $c )

   print( "TestSub called with " + $a + ", " + $b + " and " + $c )

endsub

Each function has a return-value which can be set by "return", which additionally exits the function immediately:

print( TestSub( 1, "two", 3 ) )

quit

sub TestSub( $a, $b, $c )

   return( "TestSub called with " + $a + ", " + $b + " and " + $c )

endsub

If no return-value is given, it is always set to 0 by a final "endsub", which is just an equivalent to "return( 0 )".

Please note, that the "endsub" in the example above is not really needed, as the function was already left by the previous "return". It's just there to make the script more "readable" and it's a good idea to a) always note it at the very end of a function and b) only there.

Parameters by value / by "reference"

By default, all parameters of a function are "called by value", which means, that their values are copied to their counterparts given in the parameter-list of the "sub". The values of the variables used for calling the "sub" are left unchanged:

var( $a )

$a = 1

TestSub( $a )

print( $a )  # -> 1 (unchanged by TestSub)

quit

sub TestSub( $x )

   $x = 42

endsub

If a variable in the parameter-list of a functon is preceded with a "*", its value is copied back to its counterpart when the function is left, so the value of the variable used for calling the function can be changed within the function:

var( $a )

$a = 1

TestSub( $a )

print( $a )  # -> 42 (changed by TestSub)

quit

sub TestSub( *$x )

   $x = 42

endsub

Please note, that this "call by 'reference'" is only somewhat "simulated" in Hamster-scripts, which might cause some unexpected behaviour compared to other languages.

As no real references are supported, a "by reference"-parameter is copied the same way as a "by value"-parameter when the function is called. The difference between those calling-types is, that the values of "by reference"-parameters are copied back when the function is left again.

Therefore, the value of a global variable used when calling a function remains untouched while the function is actually executed (only its "reference"-copy is changed), and if the "original" global variable is changed during function-execution, its value would be overwritten with the value of its "reference" afterwards. I hope, that it is so exotic as it sounds ... ;->

Scope of variables

All variables declared within a function are local to this function. When the function is left again, they are deleted.

Global variables (i.e. declared outside of any function) are accessible within the function, unless a variable with the same name is created in it:

var( $a )

$a = 1

print( $a )  # -> 1

TestSub

print( $a )  # -> 42

quit

sub TestSub

   print( $a ) # -> 1

   $a = 42

   print( $a ) # -> 42

   var( $a )   # global $a is from now on "out of scope"

   $a = 666

   print( $a ) # -> 666

endsub


Functions, Hamster (scripts)
Hamster-Scripts: Functions (Hamster)

HamVersion

Returns the version number of Hamster.

Returns: String with version-number (e.g. "1.3.17.0").

print( "Hamster Vr. " + HamVersion )

HamPath

Returns the base-path of Hamster, i.e. the path were "Hamster.exe" is located.

Returns: String with full qualified path-name and trailing backslash.

if( FileExists( HamPath + "Mails\Mail.Out\*.msg" ) )

   # send mails

endif

HamMessage( <message>, <parameter> )

HamMessage( <message> )

Initiates some Hamster-functions, which are normally available and accessed by its menu-items:

<message>	<parameter> (default=0)	purpose
1	ignored	Exit Hamster
2	ignored	Reset counters and log
3	0=stop, 1=start	Start/Stop local NNTP-server
4	0=stop, 1=start	Start/Stop local POP3-server
5	0=stop, 1=start	Start/Stop local SMTP-server
6	0=hide, 1=show	Hide/show main-window
7	0=hide, 1=show	Hide/show tray-icon
8	ignored	Menu: Online/Stop all tasks
Returns: 0=OK, 1=Failed, 2=Unknown message-number, 3=GPF

HamMessage( 2, 0 ) # reset counters

HamThreadCount

Gives the number of currently active tasks.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

Returns: Integer

print( HamThreadCount )

HamIsIdle

Returns TRUE (1) if there are currently no active tasks like purging, pulling news, sending mails etc.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

Returns: Integer

if( HamIsIdle )

   # ...

endif

HamWaitIdle( <timeout> )

HamWaitIdle

Waits up to the given amount of milliseconds until all active tasks are finished. If no <timeout> is given, the function does not return until Hamster is idle again.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

Returns: 0=OK, 1=Timeout, 2=Interrupted

HamWaitIdle

HamFlush

Writes unsaved data to disk. Suggested after last article imported with HamArtImport.

Returns: 0

HamFlush

HamPurge( <option> )

HamPurge

Starts a purge-thread (i.e. the deletion of old data). The bit-oriented parameter <option> describes, which old data should be deleted (1=articles, 2=news-history, 4=killfile-log, 8=mail-history). If it's omitted, all type of data are purged.

Returns: 0=OK/Started, <>0=Not started

HamWaitIdle

HamPurge( 4 )

HamWaitIdle

HamRebuildGlobalLists

Starts a thread, which rebuilds some lists needed by Hamster, especially the list of newsgroups used for selecting new news-pulls.

Returns: 0=OK/Started, <>0=Not started

HamWaitIdle

HamRebuildGlobalLists

HamWaitIdle

HamRebuildHistory

Starts a thread, which deletes the current news-history and rebuilds it by adding the Message-IDs of all articles stored in Hamster.

Note: This may take some time with thousands of articles, so it should only be used, if it's really necessary! Be sure to wait until Hamster is idle again after calling this function!

Returns: 0=OK/Started, <>0=Not started

HamWaitIdle

HamRebuildHistory

HamWaitIdle

HamSetLogin( <identifier>, <username>, <password> )

Temporarily sets <username> and <password> for the given <identifier>, which can be either the name of a RAS-connection or the name of a news-/mail-server. "Temporarily" means, that this setting is not saved to a file but is kept in memory until Hamster is closed again.

If username and/or password is set to a single question-mark ("?"), Hamster will ask for the value.

Furthermore, one of the stored "general-purpose"-passwords can be selected here to avoid noting it in clear-text in the script.

Returns: 0=OK, <>0=Error

HamSetLogin( "MyProvider", "MyUsername", "MyPassword" )

HamSetLogin( "MyProvider", "MyUsername", "?" )

HamSetLogin( "MyProvider", "$42", "" )

HamNewsPull( <server-list> )

HamNewsPull

Starts the threads, which pull new articles from newsservers.

If <server-list> is omitted or set to an empty string (""), all NNTP-servers defined in Hamster will be used. Otherwise, transfer is restricted to the given servers.

If used, <server-list> has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port), e.g.: "news.aaa.com,nntp;news.bbb.com,nntp"

Note: Starting with Hamster Vr. 1.3.19, this function was replaced with the NewsJobs*-functions described below and is only simulated internally with these new functions. See the example at "HamNewsJobsStart" for a replacement of this obsolete function.

Returns: 0=OK/Started, <>0=Not started

HamNewsPull

HamNewsPull( "one.newsserv.er,nntp;two.newsserv.er,nntp" )

HamNewsPost( <server-list> )

HamNewsPost

Starts the thread, which posts new articles (if any).

If <server-list> is omitted or set to an empty string (""), all NNTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers.

If used, <server-list> has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port), e.g.: "news.aaa.com,nntp;news.bbb.com,nntp"

Note: Starting with Hamster Vr. 1.3.19, this function was replaced with the NewsJobs*-functions described below and is only simulated internally with these new functions. See the example at "HamNewsJobsStart" for a replacement of this obsolete function.

Returns: 0=OK/Started, <>0=Not started

HamNewsPost

HamNewsPost( "one.newsserv.er,nntp;two.newsserv.er,nntp" )

HamNewsJobsClear

Clears the list of news-related jobs.

Returns: 0

HamNewsJobsClear

HamNewsJobsPullDef( <server-list> )

HamNewsJobsPullDef

Fills the list of news-related jobs with the pull-list of the given newsservers (i.e. one job for each group to pull from a server).

If <server-list> is omitted or set to an empty string (""), all groups of all NNTP-servers defined in Hamster will be added. Otherwise, only the groups for the given servers will be added.

If used, <server-list> has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port), e.g.: "news.aaa.com,nntp;news.bbb.com,nntp"

Returns: <0: Error, >=0: Number of pull-jobs added

HamNewsJobsPullDef

HamNewsJobsPullDef( "one.newsserv.er,nntp;two.newsserv.er,nntp" )

HamNewsJobsPostDef( <server-list> )

HamNewsJobsPostDef

Fills the list of news-related jobs with post-jobs for the given newsservers (i.e. one job for each article waiting to be posted).

If <server-list> is omitted or set to an empty string (""), all NNTP-servers defined in Hamster may be used to post the article. Otherwise, transfer is restricted to one of the given servers.

If used, <server-list> has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port), e.g.: "news.aaa.com,nntp;news.bbb.com,nntp"

Returns: <0: Error, >=0: Number of post-jobs added

HamNewsJobsPostDef

HamNewsJobsPostDef( "one.newsserv.er,nntp;two.newsserv.er,nntp" )

HamNewsJobsPull( <server>, <group-select> )

HamNewsJobsPull( <server> )

Fills the list of news-related jobs with the pull-list of the given newsserver <server>.

If <group-select> is given, only the groups matching this regular expression are added.

Returns: <0: Error, >=0: Number of pull-jobs added

HamNewsJobsPull( "one.newsserv.er" )

HamNewsJobsPull( "two.newsserv.er", "^alt\." )

HamNewsJobsPost( <server>, <group-select>, <header-select> )

HamNewsJobsPost( <server>, <group-select> )

HamNewsJobsPost( <server> )

Fills the list of news-related jobs with post-jobs for the given newsserver <server>.

If <group-select> is given and not empty, only articles with a newsgroup matching this regular expression are added.

If <header-select> is given, only articles with a header-line matching this regular expression are added.

Note: Hamster does not support "multiple injection", so once an article is added to the list, it is ignored in further assignments.

Note: Hamster only posts to servers, from which a group is also pulled, so regardless which selections you choose, the resulting server/group-combination has to be in Hamster's pull-list, too.

Returns: <0: Error, >=0: Number of post-jobs added

HamNewsJobsPost( "one.newsserv.er", ".*", "^X-Post-To: one.newsserv.er" )

HamNewsJobsPost( "two.newsserv.er", "^alt\." )

HamNewsJobsPost( "one.newsserv.er" )

HamNewsJobsStart( <server-list> )

HamNewsJobsStart

Starts transfer-threads for the given servers that have pending news-jobs.

If <server-list> is omitted or set to an empty string (""), threads for all newsservers with pending news-jobs are started. Otherwise, only threads for the given servers are started.

If used, <server-list> has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port), e.g.: "news.aaa.com,nntp;news.bbb.com,nntp"

Returns: <0: Error, >=0: Number of threads started

# replacement for HamNewsPost and HamNewsPull:

HamNewsJobsClear

HamNewsJobsPostDef

HamNewsJobsPullDef

HamNewsJobsStart

HamMailExchange( <server-list> )

HamMailExchange

Starts the thread, which first fetches new mails from the mailservers and then sends out mails (if any).

If you omit <server-list> or set it to an empty string (""), all POP3- and SMTP-servers defined in Hamster may be used. Otherwise, transfer is restricted to the given servers.

If used, the <server-list> has to consist of a semicolon-separated (";") list of servernames. The servernames have to be in the same format as displayed in the Hamster-settings (i.e. servername + "," + port).

NOTE: It's suggested to use "HamFetchMail" and "HamSendMail" instead, as these commands also support the different mail-accounts and the mail-filters of Hamster, that "HamMailExchange" doesn't.

Returns: 0=OK/Started, <>0=Not started

HamMailAll

HamMailAll( "one.mailserv.er,pop3;two.mailserv.er,smtp" )

HamFetchMail( <server>, <port>, <user>, <pass>, <destuser>, <filter> )

...

HamFetchMail( <server> )

Starts a thread, which fetches mails from the given POP3-server (<server>, <port>).

If <user> (username) and <pass> (password) are given, they will be used to login to the server, if they are both empty, the password-setting for the given server is used. Furthermore, one of the stored "general-purpose"-passwords can be used here to avoid noting it in clear-text in the script (<user>="$(number), <pass>="").

If <destuser> is given, fetched mails will be stored in the mailbox of this user, "admin"-mailbox is used otherwise.

If <filter> is given, it determines the filter-section to use for the mails fetched with this commands (default is global filters only, i.e. "[*]"-section in MailfFilt.hst).

Returns: 0=OK/Started, <>0=Not started

HamFetchMail( "pop3.serv.er", "pop3", "", "", "", "" )

HamFetchMail( "pop3.serv.er", "", "john.doe", "secret", "john", "" )

HamFetchMail( "pop3.serv.er", "10110", "$7", "", "jane", "" )

HamFetchMail( "pop3.serv.er", "", "$42", "", "admin", "myfilters" )

HamSendMail( <server>, <port>, <from-select> )

...

HamSendMail( <server> )

Starts a thread, which sends mails to the given SMTP-server (<server>, <port>).

If no <from-select> is given, all mails waiting for delivery are sent. If a selection is given (regular expression), only mails with a matching Envelope-From are sent to this server.

Returns: 0=OK/Started, <>0=Not started

HamSendMail( "smtp1.serv.er", "smtp", "john\.doe@serv\.er" )

HamSendMail( "smtp2.serv.er" )

HamSendMailAuth( <server>, <port>, <user>, <pass>, <from-select> )

...

HamSendMailAuth( <server> )

Like "HamSendMail" above, but additionally allows to provide username and password used for authentication.

Note: Username and password are ignored, if SMTP authentication is not enabled for the given server (see notes on SMTP authentication under "Mailserver").

Returns: 0=OK/Started, <>0=Not started

HamSendMailAuth( "smtp3.serv.er", "smtp", "$42", "", "@smtp3\.serv\.er" )

HamRasDial( <name>, <user>, <pass> )

...

HamRasDial( <name> )

Dials the RAS-connection named "<name>" and tries to authenticate with username <user> and password <pass> (if given).

If <user> and/or <pass> is omitted or set to empty strings (""), the settings of "HamSetLogin" (if any) or the values stored in Hamster are used to establish the connection. This function also supports one of the stored "general-purpose"-passwords to avoid noting it in clear-text in the script (<user>="$(number), <pass>="").

NOTE: If this function is used, "HamRasHangup" should be used to terminate the connection again.

Returns: 0=OK/connected; >0=error-code; -1=RAS not installed

$try = 1

while( HamRasDial( "MyProvider","$42" ) != 0 )

   if( $try >= 3 )

      error( "Dialing failed!" )

   endif

   inc( $try )

   sleep( 10000 )

endwhile

HamRasHangup

Terminates an existing RAS-connection.

Returns: 0: OK; >0: error-code; -1: RAS not installed

HamRasHangup

HamGroupCount

Retrieves number of newsgroups available from Hamster.

Returns: >=0: OK/number of groups; <0: error

# see example at HamGroupName

HamGroupName( <index> )

Retrieves the name of the given newsgroup. <index> can be 0 to (HamGroupCount-1).

Returns: String

var( $grpidx )

$grpidx = 0

while( $grpidx < HamGroupCount )

   print( HamGroupName( $grpidx ) )

   inc( $grpidx )

endwhile

HamGroupIndex( <grpname> )

Retrieves the index-number of the given groupname.

Returns: >=0: OK/index-number; -1: unknown group

print( HamGroupIndex( "internal.misc" ) )

HamGroupOpen( <grpname> )

Opens the given group and returns a handle, which is needed to retrieve additional infos in the functions below (the handle is referenced as <grphdl> there).
If the function fails, the return-value is negative (<0).

Returns: >=0: OK/group-handle; <0: error

$grphdl = HamGroupOpen( "internal.misc" )

HamGroupClose( <grphdl> )

Closes a previously opened group.

Returns: 0

HamGroupClose( $grphdl )

HamArtCount( <grphdl> )

Retrieves the number of available articles in the group.

Returns: >=0: OK/count, <0: error

# see example at HamArtText

HamArtNoMin( <grphdl> )

Retrieve the lowest available article-number.

Returns: >=0: OK/count, <0: error

# see example at HamArtText

HamArtNoMax( <grphdl> )

Retrieve the highest available article-number.

Returns: >=0: OK/count, <0: error

# see example at HamArtText

HamArtText( <grphdl>, <artno> )

Retrieves the text for the given article-number. An empty string indicates, that an article with the given number is not available (any more).

Returns: String (article-text or "")

var( $grpnam, $grphdl, $artmin, $artmax, $artno, $arttxt )

$grpnam = "internal.misc"

$grphdl = HamGroupOpen( $grpnam )

if( $grphdl >= 0 )

   print( "Group ", $grpnam, ": ", HamArtCount($grphdl), " articles" )

   $artmin = HamArtNoMin( $grphdl )

   $artmax = HamArtNoMax( $grphdl )

   $artno = $artmin

   while( $artno <= $artmax )

      $arttxt = HamArtText( $grphdl, $artno )

      if( $arttxt <> "" )

         print( "Article ", $artno, ": ", len($arttxt), " byte" )

      endif

      inc( $artno )

   endwhile

   HamGroupClose( $grphdl )

endif

HamArtTextExport( <grphdl>, <artno> )

Same as "HamArtText", but the text is additionally converted to export-format.

Returns: String (article-text or "")

$arttxt = HamArtTextExport( $grphdl, $artno )

HamArtImport( <article>, <goverride>, <ignorehist>, <marknoarch> )

...

HamArtImport( <article> )

Imports the given <article> into Hamster's database and returns TRUE, if the article was imported, FALSE otherwise.
<article> contains the article to import, including all headers, header/body-separator and the article-body. The lines have to be separated by CR+LF (0x0d, 0x0a).
If <goverride> is empty (default), the article is stored in the groups determined by the "Newsgroups:"-header of the article. Otherwise it is stored in the group given by <goverride>. If no valid local groups are given, the article is stored in internal.misc.
If <ignorehist> is TRUE (<>0), no history-lookup is made for the Message-ID of the imported article, so it will be imported even if it's already known. Default is FALSE.
If <marknoarch> is TRUE (<>0), the imported article is marked with "NoArchive=1" in the "X-Hamster-Info:"-header. This flag might be used to mark the imported article as "temporary", so it can, for example, be ignored by appropriate archiving-software. Default is FALSE.

Returns: true/1: OK, false/0: error

HamArtImport( $article_text, "internal.misc" )

HamArtDeleteMid( <message-id> )

Locates the article identified by the given <message-id> and deletes it in Hamster's database-files. The function returns 0, if article could be located and deleted; a value other than 0 otherwise.

Returns: =0: Deleted, <>0: Message-ID not found/deletion failed

HamArtDeleteMid( "<12345.67890@abd.def.ghi>" )

HamArtLocateMid( <message-id>, <grpname>, <artno> )

HamArtLocateMid( <message-id> )

Returns 0, if the given Message-ID is (still) saved in the history-file. In this case, the variables <grpname> and <artno> will be set to point to this article. Otherwise the function returns a value other than 0 and <grpname> and <artno> remain unchanged.

Returns: =0: OK/found, <>0: Message-ID not found

if( HamArtLocateMid( "<12345.67890@abd.def.ghi>", $groupname, $artno ) )

   # ...

endif

HamScoreList( <grpname> )

Retrieves a list containing all score-entries, which will be used when pulling news for the given groupname <grpname>.

Returns: String

ListSetText( $ScoreList, HamScoreList( "group.name" ) )

HamScoreTest( <grpname>, <article>, <matchlog> )

HamScoreTest( <grpname>, <article> )

Returns the score-value for the given article <article>. The test is done with the assumption, that the article was pulled from the given newsgroup <grpname>. A CR/LF-separated list of all matching score-lines is returned in the variable <matchlog>.

Returns: Integer (score-value)

$ScoreValue = HamScoreTest( "group.name", $Article, $MatchLog )


Modules (scripts)
Hamster-Scripts: Modules

Creating modules

Modules are just scripts containing a set of often used functions. It is suggested to use the file-extension ".hsm" for modules to separate them from normal scripts (".hsc").

The only noteable thing about modules compared to normal scripts is, that they also contain a mechanism for initializing things automatically when the module is used by a script.

This initialization-mechanism is just a piece of script-code, which is marked by an "#!initialize"-line. The code directly after this marker is executed automatically when the module is used by a script.

The initialization-code must return an integer-value. A value of 0 shows a successful initialization, values other than zero prevent the script from starting (e.g. if a file needed by the module is missing).

#!initialize

   debug( 255, "<<< module 'modulename.hsm' >>>" )

return( 0 )

The initialization-code is executed within the global context of the started script, so all variables created and used in the initialization-code are global afterwards.

#!initialize

   debug( 255, "<<< module douglas_adams.hsm' >>>" )

   var( $THE_ANSWER )

   $THE_ANSWER = 42

return( 0 )

As it is not possible to protect module-wide variables from being changed by the calling script, it is suggested to at least use names which rarely should be used by someone else. A convention, that might also be used for script-internal functions, is to precede such names with the name of the module like in the following example:

#!initialize

   debug( 255, "<<< module 'modulename.hsm' >>>" )

   var( $modulename_hsm_Counter )

   $module_name_hsm_Counter = 0

return( 0 )

sub modulename_hsm_ThisSubOnlyNeededWithinModule

   # ...

endsub

Using modules

To use existing modules within a script, they have just to be loaded by "#!load"-commands:

#!load hamster.hsm

#!load htime.hsm

If one of the loaded modules also contains "#!load"-commands, these dependant modules will also be loaded automatically. Each module will only be loaded once, regardless of how often and where it is loaded.

After all requested modules are loaded and before the actual script-code is executed, the initialization code of all modules is executed in reverse order of loading them.